I’m trying to edit a txt file by removing certain line numbers from it.
i would like to search for all files in the folder containing .txt, remove some lines and than save the file using the inputfilename with -edit.txt
like: input.txt > input-edit.txt.
this is what i have at the moment:
@echo off (for /f "tokens=1,* delims=[]" %%a in ('type *.txt^|find /v /n ""') do (
echo/|findstr /x "34 35 36 37 38 39 40 41 42 43 80 81 82 83 84 85 86 87 88 89" >nul || echo/%%b
))>%%~na-edit.txt
But the filename that’s created is %~na-edit.txt
Can anyone help me?
Thanks!
New contributor
waterblauw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.