|Anyways..I have checked for my data..it is not working as it has data in each line and two text files are seperate|
Atlast help me with one thing...can we delete a line in a text file thru for loop..i searched..but no where i found the help...
The Code I posted in #9 does run over two files("file1" and "file2"), albeit inefficiently and in very limited scope.
To delete a line you have to run a for loop over the file, exclude the unwanted line, output to a new file the delete the old file and rename the new file or move the new file over the top of it.
This should work to exclude a line by line number(blank lines will cause an issue).
for /f "usebackq delims=" %%a in ("your file") do (
set /a line+=1
for /f %%b in ('call echo %%line%%') do (
if not %%b==%exclude% (
>> newfile echo %%a
move "%cd%\newfile" "%cd%\yourfile"