I am looking at trying to write a batch script that searches files in a folder to remove lines and then copy the edited file to an output folder.
The contents of the files are as follows;
R10090035 154 0.600 1.7
R10090045 26 2.400 2.3
R10140035 1 0.300 4.2
R10140035 1 0.900 4.2
At the moment I can do this with findstr by specifying the file to be searched/edited but but i would like to ditch this and do this to all files in a folder if they are there and output them to each file once scrubbed.
Current batch script so far;
set /P JOBNO=Please enter the job number?
if EXIST %EXPORTPATH%\%JOBNO%.ftr (
echo Exporting Files
findstr /v /c:"R10140035" %EXPORTPATH%\%JOBNO%.ftr >"%DESTPATH%%JOBNO%.ftr"
del /q %EXPORTPATH%\*.ftr
for /d %%x in (%EXPORTPATH%\*.ftr) do @rd /s /q "%%x"
) ELSE (
echo %JOBNO%.ftr missing.
echo Please try and re-export the Prostix job file from PrydaBuild.
Could the FOR command be used? If so how would that be structured?
Thanks in advance.