I have a text file that contains something like the following:
blah, blah, blah ...
Text : {string1, string2, string3,
string4, string5, string6,}
blah, blah, blah ...
Text : {string7, string8, string9,
string10, string11, string12,}
and I would like to merge only the lines between the braces into one line to look like this:
blah, blah, blah ...
Text : {string1, string2, string3, string4, string5, string6,}
blah, blah, blah ...
Text : {string7, string8, string9, string10, string11, string12,}
However, I don't want to apply the change to the entire text file because it contains other things. I would like to edit only the text between braces { ... }. I messed around with -join but couldn't get it to work. I have the following script which opens the file, makes changes, and output into another file:
gc input.txt |
# Here I have several editing commands, like find/replace.
# It would be great if I could add the new change here.
sc output.txt
Thank you!