[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Need help with a sed script
- Subject: [ale] Need help with a sed script
- From: jimpop at yahoo.com (Jim Popovitch)
- Date: Thu May 12 18:37:21 2005
- In-reply-to: <[email protected]>
- References: <[email protected]>
Here is how I would do it, although there probably is 100 ways:
sed -e 's/\(..\)\(....\)\(.*\)/\2\1\3/' in-file > out-file
-Jim P.
On Thu, 2005-05-12 at 17:58 -0400, Greg Freemyer wrote:
> I don't use sed very often, does anyone know how to 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.
>
> PS: Any tool can be used, but I have 80,000 lines to modify in a
> single file, and sed is the only tool I know for the job.
>
> Thanks
> Greg