Have been through FAQ, Powertips, and searched this find forum but not able to find what I am looking for...
I am using UE 11.20+4 with Unix regexp
I have several text files that I need to manipulate. Here is a bogus sample for discussion purposes:
abc bbb [abcdefg:hijk] qwe bbb ccc
asd
aaa bbb THEWORD aaa bbb
qwe
aaa bbb [bbcdefg:hijk] aaa bbb ccc
asd
aaa bbb THEWORD aaa bbb THEWORD
qwe THEWORD
I want the resulting file to look like this:
abcdefg:hijk,THEWORD
bbcdefg:hijk,THEWORD THEWORD THEWORD
I am basically looking for any text within the square brackets and I am also looking for a specific string ("THEWORD" in this example)
I wanted to use tagged expression search/replace but couldn't get past the search part:
(\[.+\]|THEWORD)
To test the search component, I was thinking to "List Lines Containing Strings" which would show me a list of all lines that had either a string within square brackets or "THEWORD" in it. BUT it only shows lines that have "THEWORD" in it. "\[.+\]|" works fine by itself, but not when I add it to the OR search expression.
I want to delete all text from the beginning of the line to the "[" and to delete all characters from the "]" to (and INCLUDING) the end of line EXCEPT for any occurences of "THEWORD"
I also want to make sure that on those lines that do NOT have square brackets in it but have "THE WORD", that all characters OTHER THAN occurences of "THE WORD" will be deleted
I figured I could use tagged expressions (e.g. /1) to help, although I guess I would need to strip out the square brackets afterwards if I did it that way.
Would appreciate some help...!
With Regards-
Sam
I am using UE 11.20+4 with Unix regexp
I have several text files that I need to manipulate. Here is a bogus sample for discussion purposes:
abc bbb [abcdefg:hijk] qwe bbb ccc
asd
aaa bbb THEWORD aaa bbb
qwe
aaa bbb [bbcdefg:hijk] aaa bbb ccc
asd
aaa bbb THEWORD aaa bbb THEWORD
qwe THEWORD
I want the resulting file to look like this:
abcdefg:hijk,THEWORD
bbcdefg:hijk,THEWORD THEWORD THEWORD
I am basically looking for any text within the square brackets and I am also looking for a specific string ("THEWORD" in this example)
I wanted to use tagged expression search/replace but couldn't get past the search part:
(\[.+\]|THEWORD)
To test the search component, I was thinking to "List Lines Containing Strings" which would show me a list of all lines that had either a string within square brackets or "THEWORD" in it. BUT it only shows lines that have "THEWORD" in it. "\[.+\]|" works fine by itself, but not when I add it to the OR search expression.
I want to delete all text from the beginning of the line to the "[" and to delete all characters from the "]" to (and INCLUDING) the end of line EXCEPT for any occurences of "THEWORD"
I also want to make sure that on those lines that do NOT have square brackets in it but have "THE WORD", that all characters OTHER THAN occurences of "THE WORD" will be deleted
I figured I could use tagged expressions (e.g. /1) to help, although I guess I would need to strip out the square brackets afterwards if I did it that way.
Would appreciate some help...!
With Regards-
Sam