Computing.Net > Forums > Unix > wrap line > 80 chararacter

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

wrap line > 80 chararacter

Reply to Message Icon

Name: dr0871
Date: July 9, 2004 at 08:36:08 Pacific
OS: Sun OS 5.8
CPU/Ram: not sure
Comment:

Is there any any simple command to wrap lines in a file which are more than 80 character long ?

dkr



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: July 9, 2004 at 09:45:53 Pacific
Reply:

awk '{ll=int(length($0)/70) ; i=1 ; \
if (length($0)>72) { \
{ print substr($0,0,70) } \
while (i<=ll) { { print " " substr($0,i*70+1,70) } i=i+1} \
} else { \
{ print ($0) } } }' infile > outfile


0

Response Number 2
Name: dr0871
Date: July 9, 2004 at 13:49:21 Pacific
Reply:

Looks good. Thank you !!!

dkr


0

Response Number 3
Name: Wolfbone
Date: July 9, 2004 at 15:50:51 Pacific
Reply:

Is 'fold' not available on Sun OS 5.8?


0

Response Number 4
Name: dr0871
Date: July 12, 2004 at 06:43:20 Pacific
Reply:

Yes, 'fold' is available. good. thanks,

dkr


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


filesystem full awk help for the



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: wrap line > 80 chararacter

joining lines with sed www.computing.net/answers/unix/joining-lines-with-sed/6674.html

Make vi do horizontal scrolling www.computing.net/answers/unix/make-vi-do-horizontal-scrolling/6629.html

vi is wrapping at 80th column www.computing.net/answers/unix/vi-is-wrapping-at-80th-column/8068.html