Operating System - HP-UX
1839301 Members
1768 Online
110138 Solutions
New Discussion

Re: simple problem: ^M appending in all lines while ftp from win to unix

 
bhupesh m
Frequent Advisor

simple problem: ^M appending in all lines while ftp from win to unix

simple problem: ^M appending in all lines while ftp from win to unix
i saw a single line command, now not able to recall and search also not helping.
what is that command..?
8 REPLIES 8
Mel Burslan
Honored Contributor

Re: simple problem: ^M appending in all lines while ftp from win to unix

command you are looking for is dos2unix or some variation of it.
it is available on both windows and unix platforms. just google the term dos2unix or unix2dos.

you will come up with many sources.
________________________________
UNIX because I majored in cryptology...
Jonathan Fife
Honored Contributor

Re: simple problem: ^M appending in all lines while ftp from win to unix

There is the dos2ux command, which strips trailing ^Ms from lines. You could also go into vi and do :%s/$//

HTH

Decay is inherent in all compounded things. Strive on with diligence
Pete Randall
Outstanding Contributor

Re: simple problem: ^M appending in all lines while ftp from win to unix

Simply run the command ux2dos against the file after it is transferred to your unix machine. Do a man on ux2dos for details.


Pete

Pete
Peter Nikitka
Honored Contributor

Re: simple problem: ^M appending in all lines while ftp from win to unix

Hi,

if transferrin ASCII files from WIN to Unix, do not use mode 'binary' but 'ascii' -
just enter at the ftp prompt:
ftp> asc

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Mel Burslan
Honored Contributor

Re: simple problem: ^M appending in all lines while ftp from win to unix

or as I easily forgot

/usr/bin/dos2ux myDOSfile > myUXfile
________________________________
UNIX because I majored in cryptology...
IT_2007
Honored Contributor

Re: simple problem: ^M appending in all lines while ftp from win to unix

you can edit that file with vi and remove ^M characters

:g/ctrl-vctrlm/s///g

Peter Godron
Honored Contributor

Re: simple problem: ^M appending in all lines while ftp from win to unix

bhupesh m
Frequent Advisor

Re: simple problem: ^M appending in all lines while ftp from win to unix

thanks a lot.