12 May
2005
12 May
'05
22:20
On Friday 13 May 2005 00:09, Greg Freemyer wrote:
Anders,
I see your online, maybe you can answer this fairly quickly for me.
I don't use sed very often, how do I shift the first 2 chars of every line to chars 5 & 6.
In otherwords if I have lines like:
123456rest of line.
I need it to be:
345612rest of line.
Reading a tutorial, I think it is something like: sed -e 's@^\(?\)\(?\)\(?\)\(?\)\(?\)\(?\)@\3\4\5\6\1\2@' file
Well, that looks like it might be made to work. This sed -e 's/\(..\)\(....\)/\2\1/' file seems to work when I just tried it.