views:

48

answers:

1

Hi,

i want to convert CR to CR+LF in batch file. Howe can i do this by writing batch file. Please help.

I am taking input from file and in that file i want to change CR to CR+LF

+1  A: 

you could use the good old unix command awk:

awk 'sub("$", "\r")' unix.txt > win.txt
Oliver
We have a shell script file named LineFeed.sh which does a function of convertinf a Linefeed(LF) to Carriage Return + LineFeed. We want the same to be done by a batch file in windows . Is it possible.Regards,SureshDharmdaurai
@sureshdharmadurai: it is certainly possible but I doubt it will be possible with the *standard* available dos commands.
Lieven
@Lieven: not in DOS but in Windows batch files easily: http://stackoverflow.com/questions/3110031/batch-file-convert-lf-to-crlf/3112785#3112785
Joey
@Johannes: very nice, thx. Yet another tool for my toolbox.
Lieven