1

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

user375191
  • 123
  • 2
  • 4
  • 7
  • 2
    This is essentially the same question as: http://stackoverflow.com/questions/3110031/batch-file-convert-lf-to-crlf – NealB Jun 24 '10 at 17:41

1 Answers1

1

you could use the good old unix command awk:

awk 'sub("$", "\r")' unix.txt > win.txt
Oliver
  • 236
  • 1
  • 7
  • 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 – user375191 Jun 24 '10 at 12:13
  • @sureshdharmadurai: it is certainly possible but I doubt it will be possible with the *standard* available dos commands. – Lieven Keersmaekers Jun 24 '10 at 13:08
  • @Lieven: not in DOS but in Windows batch files easily: http://stackoverflow.com/questions/3110031/batch-file-convert-lf-to-crlf/3112785#3112785 – Joey Jun 24 '10 at 18:21