| Date: Thu, 15 Dec 2005 23:03:35 +0000
| From: Braun Brelin <bbrelin at gmail.com>
|
| so i'm trying to figure a regular expression to do the following:
| Take a single (really long) line and break it up into 80 character
| lines. i.e. after every 80th character, insert a newline [ ... ]
as others have pointed out, fold(1) is yer answer.
but anyway, here's the ERE you wanted (GNU sed(1)):
sed -e 's/.\{80\}/&\n/g'
add pepper to taste for vim(1) &tc.
cheers!
-blf-
--
Experienced (20+ yrs) kernel/software Eng: | Brian Foster Montpellier,
• Unix, embedded, &tc; • Linux; • doc; | blf at utvinternet.ie FRANCE
• IDL, automated testing, process, &tc. | Stop E$$o (ExxonMobile)!
Résumé (CV) http://www.blf.utvinternet.ie | http://www.stopesso.com
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!