i have a file file1
in with unix eol,
i have a script to do some editing in it, but the editing is done into output.txt
and is renamed as file1
and this changes the eol to windows/dos
the code is given
set uu=file1
set vv=file2
setlocal EnableDelayedExpansion
(for /F "delims=" %%a in (%uu%) do (
set "line=%%a"
if "!line:345=!" neq "!line!" (
if "!line:123=!" neq "!line!" (
if not defined flag (
findstr "123" %vv% | findstr "345"
set flag=true
)
) else (
echo !line!
)
) else (
echo !line!
)
)) >output.txt
del %uu%
rename output.txt file1
any way to change it back or retain unix eol via cmd without user input?
have tried directly inputing into the file1, gives a 0 kb file
tried type output.txt>file1
gave dos/win eol
echoing anything other than a blank line echo.>file1
changed the eol char