Hello DOS Tips,
We are trying to insert a suffix to the END of EVERY line in a file.
so we are trying to add a quote mark to the end of each line with
setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in (c:\sandbox\original.txt) do
set /a N+=1
echo ^"%%a^" ^>c:\sandbox\new.txt
c:\sandbox\original.txt
"Jack and Jill went up the hill
"Jill and Jack went up the hill
c:\sandbox\new.txt
"Jack and Jill went up the hill"
"Jill and Jack went up the hill"
...but there is something wrong with the syntax and my brain is melting.
Help please
Insert suffix to every line in TXT file
Moderator: DosItHelp
Re: Insert suffix to every line in TXT file
Code: Select all
@echo off
(for /f "delims=" %%a in (c:\sandbox\original.txt) do (
set /a N+=1
echo %%a"
))>c:\sandbox\new.txt
Re: Insert suffix to every line in TXT file
thank you so much sir!
Aisha
Aisha