edited to match comment 9000 characters, and cmd cant hold that many characters
(simple: write first line without line feed, add second line):
(if there still are too many characters, jrepl.bat can help)
@echo off
setlocal enabledelayedexpansion
<c.txt (
set /p "line1="
set /p "line2="
)
<nul >c.txt set /p "=!line1:"=!"
>>c.txt echo %line2%
read the two lines into two variables, write both back to file, removing the quotes from the first one.
Note: Delayed expansion might/might not be needed for each of the variables (maybe separately), depending on present characters. (here the &
in the first line needs delayed expansion).
another edit to match only the second line.
Process the first line as above. For the second line, just use more +1
. This will work regardless of the line length. Contra: you have to use a secondary file. Pro: no problems with special chars (in the second line).
@echo off
setlocal enabledelayedexpansion
<c.txt set /p "line1="
<nul >c.out set /p "=!line1:"=!"
more +1 c.txt >>c.out
move /y c.out c.txt