WIndows and LF to CR/LF issues

I have a file that apparently originated from Line, and I need to convert it to Windows format

What is the easiest way to do that

Thanks
Anthony LuciaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RizzleCommented:
Do you mean originated from Linux?

Also if its from Linux heres the solution.

If you’re using a UNIX based system to transfer the files to a Windows system, there are some commands that let you convert the text file(s) you are transferring to a format Windows can understand.

The dos2unix and unix2dos command

unix2dos_conversion

You can use command line to safely convert files from UNIX to Windows and vice versa. To convert a Windows text file to a UNIX text file, enter this:


dos2unix windows.txt unix.txt
 

The above command converts and replaces “windows.txt” file to “unix.txt”. To convert a UNIX text file to a Windows text file, enter this command:


unix2dos unix.txt windows.txt
 

The above command will convert a UNIX created text file called “unix.txt” to a Windows compatible text file called “windows.txt”.

The awk command

The awk command also lets you convert a file from UNIX to Windows and vice versa. To convert a Windows file to a UNIX file, enter the following command:


awk '{ sub("\r$", ""); print }' windows.txt > unix.txt
 

To convert a UNIX text file called “unix.txt” to a Windows text file called “windows.txt”, enter the following command:


awk 'sub("$", "\r")' uniz.txt > windows.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Anthony LuciaAuthor Commented:
I am on WIndows 2008 R2

Neither dos2unix or awk work in this env on the command prompt

Any ideas ?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.