Convert UNIX files to DOS format [duplicate]

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.


Solution 1:

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

Solution 2:

Here is an easy and quick way.

Drag and drop the text file into Chrome (I don't know about other browsers) and then cut and paste back into the original file :)