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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP Adding Extra CR/LF After Every Record

Status
Not open for further replies.

mark1110

Programmer
Apr 20, 2005
85
0
0
US
Hi,

A user is FTPing a text file from a windows network file server to my HP UNIX server. When I receive the file it contains a CR/LF after every record. The file on his end doesn't have these CR/LF. Does anyone know why I would get these and what can I do to correct this?

Thanks,

Mark
 

This is a legacy difference between UNIX and DOS/WINDOWS text conventions. UNIX expects a text line to end with LF, the DOS/WINDOWS convention is LF/CR as the line terminator. The LF/CR terminators _are_ there in Windows, it just doesn't show them to you.

Try setting ASCII mode in the FTP session.

HP-UX also has 'dos2ux' and 'ux2dos' conversion utilities, consult your 'man' pages.
 
I think it could be the reverse; if these really are "extra" CR/LFs that didn't exist on the original file then the user is probably transferring it in 'ascii' mode rather than 'binary', which should preserve it in its original state. If they use the 'bin' command before 'put'ting the file, that should fix it.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top