Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File with No Carriage Return

Status
Not open for further replies.

Dagon

MIS
Jan 30, 2002
2,301
GB
Are there any tools in UNIX to process files which don't have any carriage returns i.e. they consist of one long stream of characters ?

Vi can't cope with files of that type because it has an upper limit of 255 characters on the length of lines. Likewise, awk. I'd like to be able to insert carriage returns into the file so that I can view it properly with vi, but can't find anything in UNIX which do the job.



 
Not sure if this will work on such a file, but have you tried fold -w [width req] [filename] > [newfile]

HTH.
 
if there is no CR, is there a linefeed? i assume there is no newline since otherwise it would work fine. if there is a linefeed or any other delimiter you can try sed or perl. i used perl to do this on a very large /etc/exports, putting each hostname on a separate line in a new file, editing, then reassembling into a proper exports file.

IBM Certified -- AIX 4.3 Obfuscation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top