1834827 Members
2298 Online
110070 Solutions
New Discussion

Re: special code

 
ivychung2
Frequent Advisor

special code

I am trying to ftp a text file from ux to pc , but I found that some files can
't be transfer , it seems there are some special code/character in the file eg. ^M ( this kind of code/character can't be read normally ), but I am not sure what is these special code/character , could advise is there any such special code/character ? thx
5 REPLIES 5
Arunvijai_4
Honored Contributor

Re: special code

Hello,

These are Control characters when you transfer files from DOS to Unix. You can easily remove them.

# dos2unix inputfile outputfile

# sed 's(ctrl v ctrl m)g//g' old.file > new.file

# strings > good_file

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
ivychung2
Frequent Advisor

Re: special code

thx

how can I read such special code in the file ? so that I can remove it manually . thx
ivychung2
Frequent Advisor

Re: special code

thx reply ,

please ignore the question.
Muthukumar_5
Honored Contributor

Re: special code

If you are transferring to pc from ux machine then ^M characters are needed. To get that,

# ux2dox filename

will give a file name which work on pc. To view then,

# cat -v

print those characters.

--
Muthu
Easy to suggest when don't know about the problem!
Arturo Galbiati
Esteemed Contributor

Re: special code

Hi,
probably if you will use ascii as transfer type the file will be correctly converted and
^M removed
HTH,
Art