1

I Want to create batch script to replace carriage return(CR) by CRLF (carriage return and Line Feed).It should be use for other text file also, I can replace that in notepad++ but want to replace for more than 1 file so need to create a separate batch file which on execution replace that CR by CRLF. Can anyone help me out in these situation.

Thank You

  • Have you looked at https://stackoverflow.com/questions/19127741/replace-crlf-using-powershell and https://stackoverflow.com/questions/44626938/powershell-v2-replace-crlf-with-lf ? – Yeti May 16 '18 at 09:12

1 Answers1

0

you can use notepad++ itself to mass replace

open a command prompt type notepad++.exe -noseesion -r .

this will open all the files in a directory only without any files from previous session

hit ctrl+h and replace in all documents

C:\massreplace>ls
001.bin                               001.txt  002.txt  004.txt
001.mysuperdupersecretsauceextension  001.yuk  003.txt  005.txt

C:\massreplace>"c:\Program Files\Notepad++\notepad++.exe" -nosession  -r *.*

C:\massreplace>

see in the screen shot below all the 8 files are open each files has 39 lines and 38 lines have CRLF i replaced all 38*8 = 304 CRLF with LF by hitting REPLACE all in all opened documents

enter image description here

blabb
  • 8,674
  • 1
  • 18
  • 27