[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



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>