Operating System - HP-UX
1836475 Members
2177 Online
110101 Solutions
New Discussion

How do I append cr-lf to recs in a file?

 
SOLVED
Go to solution
cbres00
Frequent Advisor

How do I append cr-lf to recs in a file?

TIA
Life is too short not to have fun every single day
4 REPLIES 4
Jordan Bean
Honored Contributor

Re: How do I append cr-lf to recs in a file?


man ux2dos
cbres00
Frequent Advisor

Re: How do I append cr-lf to recs in a file?

"no manual entry for ux2dos."

Sed/awk solution?

cb
Life is too short not to have fun every single day
Jordan Bean
Honored Contributor
Solution

Re: How do I append cr-lf to recs in a file?


HP-UX? /usr/bin/ux2dos

Linux? /usr/bin/unix2dos

FTP? Transfer is ASCII mode.

To use sed in the posix or korn shells, try this:

echo "\r" | read CR
sed -e 's/$/'${CR}'/' outfile

Bill Hassell
Honored Contributor

Re: How do I append cr-lf to recs in a file?

The lack of a man page sounds like a problem installation as ux2dos and dos2ux are basic HP-UX tools.

However, 99% of the reasons for the CR/LF question is due to PCs, normally ftp or SAMBA file sharing. FTP is the only tool where the transfer will take care of the CRLF pair. SAMBA is a WYSIWYG, thus the need for dos2ux and ux2dos.


Bill Hassell, sysadmin