[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Thu May 12 18:30:12 2005 -->
- <!--x-from-r13: tert.serrzlre ng tznvy.pbz (Uert Terrzlre) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Re: Need help with a sed script -->
- <li><em>date</em>: Thu May 12 18:30:12 2005</li>
- <li><em>from</em>: greg.freemyer at gmail.com (Greg Freemyer)</li>
- <li><em>in-reply-to</em>: <<a href="msg00250.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg00250.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Re: Need help with a sed script</li>
sed -e 's@^\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)@\3\4\5\6\1\2@' infile > outfile
What could be easier? ;)
On 5/12/05, Greg Freemyer <greg.freemyer at gmail.com> 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
> --
> Greg Freemyer
> The Norcross Group
> Forensics for the 21st Century
>
--
Greg Freemyer
The Norcross Group
Forensics for the 21st Century
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00250" href="msg00250.html">[ale] Need help with a sed script</a></strong>
<ul><li><em>From:</em> greg.freemyer at gmail.com (Greg Freemyer)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00250.html">[ale] Need help with a sed script</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00252.html">[ale] OT: U.S. National Identity Cards All But Law</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00250.html">[ale] Need help with a sed script</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00254.html">[ale] Need help with a sed script</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00251"><strong>Date</strong></a></li>
<li><a href="threads.html#00251"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>