Wednesday 6 December 2017

linux - Convert Unix line endings to Windows


I recently moved back to Windows from Linux. I have some files with CRLFs, some with LFs and some that are mixed. Is there a utility that will help me find all my Unix-touched files and convert them to proper CRLF terminated files?


The utility must run on Windows, not Linux. I have already moved. I'd rather not install Cygwin if I can avoid it.



Answer



You can convert them with the unix2dos utility on your Linux platform. There are unix2dos versions available for Windows as well.


If you have Perl installed you can also use this one liner:


perl -p -e 's/\n/\r\n/' < UNIX_LF.txt > WINDOWS_CRLF.txt

No comments:

Post a Comment

Where does Skype save my contact&#39;s avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...