Remove trailing characters while adding leading characters
by sharky from LinuxQuestions.org on (#6KTW3)
Text file contains numerous strings with trailing sub-string.
example where _xx is the trailing sub-string;
Quote:
desired output:
Quote:
I found ways to make the substitution. However, with my method I lose the existing spacing - all the strings in the output are separated by a single space.
example where _xx is the trailing sub-string;
Quote:
"m1_xx" some other text "m2_xx" "p2_xx" yet more text "p2_xx" extra text change is good "hello_xx" |
Quote:
"yy_m1" some other text "yy_m2" "yy_p2" yet more text "yy_p2" extra text change is good "yy_hello" |