| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
Pls. ignore the prev. soln., which is incorrect.
sed -e '
s/\([^-].*[^-]\)\(.*\)/\2\1/;t
s/\([^-]\)\(.*\)/\2\1/
' yourfile
There are 2 types of lines of interest:
a) move what is to the right of the rightmost nondash to the left of the leftmost nondash.
b) move everything to the right of the solitary nondash to it's left.
N.B. Order of processing lines above is IMP. Must not be changed.
All other lines left as they were found.
-Rakesh
[Non-text portions of this message have been removed]