Tuesday, December 30, 2008

Converting EOLs in dos format to unix

I had a file which contains dos style EOLs in it which I couldn't see except in Vim. Being long time, I forgot how to convert them to unix style EOLs and figured out only after searching in Google. :( My memory power is decreasing day by day I can say.
any ways, the command to use is

dos2unix filename

That's it.

3 comments:

tnsatish said...

In vim, you can copy the special character, and type the following.

:%s/^M//g

Paste the copied special character in the place of ^M. It will remove all the special characters in the file.

Pallavi Palleti said...

hey Satish, this one didn't work for me. And so, I had to search for it.

Me said...

Thank you. I also always forget how to handle this.