on-internet
← Community

Replacing CRLF with ";" using sed from Windows batch file

Stack Overflow ·

I have this input with CRLF line endings: 1019 1020 1028 1021 I want to remove CRLF at end of each lines using sed, (or awk) from Gnuwin32 using a Windows 10 batch script, (not Powershell). I want to get the following result inside a text file, without any semicolon or CRLF at the end: 1019;1020;1028;1021 It doesn't work with the following lines in the batch file, (it seems there is a problem with GNUwin32 sed that adds new CRLF at end of each processed line): REM This to generate the input example : (echo 1019& echo 1020& echo 1028& echo 1021) > test_in.txt REM This is the first try for getti

Comments

Sign in or sign up to comment and upvote.

No comments yet.