[SOLVED] use sed to swap text in a string (not replace)
by Gebby_3 from LinuxQuestions.org on (#5E9XK)
I would like to swap text by using " - " as the swap position and send output of the swapped line.
There are multiple lines to search thru and swap.
There is only 1 occurrence of " - " in each line and of course different positions according to the length of each.
ex Input line:
Group Name - Song Title
ex Output line:
Song Title - Group Name
sed (condition statements) input file > output file
I am using cgywin, windows 10, mks toolkit and tcc by j.p.software


There are multiple lines to search thru and swap.
There is only 1 occurrence of " - " in each line and of course different positions according to the length of each.
ex Input line:
Group Name - Song Title
ex Output line:
Song Title - Group Name
sed (condition statements) input file > output file
I am using cgywin, windows 10, mks toolkit and tcc by j.p.software