1833862 Members
2513 Online
110063 Solutions
New Discussion

Re: ux2dos

 
SOLVED
Go to solution
Ahmed Samy Amer
Occasional Advisor

ux2dos

Hi Admins,

I have program that generates a unix format text file, and i want to convert this file to dos format without using ux2dos, but instead i write the characters for line feed and carriage return directly using my program (what ux2dos does) to be readable by Windows.

Thanks.
4 REPLIES 4
Vincenzo Restuccia
Honored Contributor

Re: ux2dos

Try doscp and in /usr/bin see ls dos*
Stefan Schulz
Honored Contributor
Solution

Re: ux2dos

As far as i know ux2dos just adds ^M to the end of the lines and ^Z to the end of the file. So you should be able to do something like:

sed -e 's/$/^M/' unixfile > dosfile
echo "^Z" >> dosfile

This should add the necessary sequences to your textfile. Note that ^M is one character - and not to characters ^ and M.

Hope this helps. Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Animesh Chakraborty
Honored Contributor

Re: ux2dos

hi
vi the file then

:1,$s/ //

hope this will work
Animesh
Did you take a backup?
Ahmed Samy Amer
Occasional Advisor

Re: ux2dos

Thank you all,

Your answers helped me a lot, i added \r\n to my program that generate the text files after each line, so files generated on UNIX can be read directly using NFS on WINDOWS.

Thank you all, Best of Luck.