Extract Text String Between Curly Braces From Multiple Files in a Directory And Save Extracted to File
Posted: 12 Jun 2017 09:06
I am hoping someone can help me with this issue.
I have a folder with multiple text files.
Each text files contains piped words/text between curly braces like this.....
{a|b|c|d} ....... {e|f|g|h} ........ {i|j|k|l|m} .....etc
OR sometimes nested curly braces like this....
{{a|b|c|{d|d1|d2|d3}}|{e|{f|f1|f2|f3}|g|h}|{i|j|k|{l|l1|l2|l3}|m}} ........... {{n|o|p|q}|{r|s|t|u}|{v|w|x|y|z}}
I need to extract all text strings between every {} and output to a single text file, each text string on a separate line.
The output needs to be in this format.....
a|b|c|d
d|d1|d2|d3
e|f|g|h
f|f1|f2|f3
i|j|k|l|m
l|l1|l2|l3
n|o|p|q
r|s|t|u
v|w|x|y|z
Any help to achieve this goal would be much appreciated.
I have a folder with multiple text files.
Each text files contains piped words/text between curly braces like this.....
{a|b|c|d} ....... {e|f|g|h} ........ {i|j|k|l|m} .....etc
OR sometimes nested curly braces like this....
{{a|b|c|{d|d1|d2|d3}}|{e|{f|f1|f2|f3}|g|h}|{i|j|k|{l|l1|l2|l3}|m}} ........... {{n|o|p|q}|{r|s|t|u}|{v|w|x|y|z}}
I need to extract all text strings between every {} and output to a single text file, each text string on a separate line.
The output needs to be in this format.....
a|b|c|d
d|d1|d2|d3
e|f|g|h
f|f1|f2|f3
i|j|k|l|m
l|l1|l2|l3
n|o|p|q
r|s|t|u
v|w|x|y|z
Any help to achieve this goal would be much appreciated.