The final goal is I am trying to loop through a filelist.txt which contains the list of files in the current folder to determine the total numbers of rows in a .csv file and once that is done if the row count is less 2 then I will move the file to a different folder. If the file has 2 rows or more the file will stay in the current folder. then move to the next file name in filelist.txt
My first step was just echoed out the file count before adding the if statement to move the files but all I get is echo on for each file name in the filelist.txt file. What am I doing wrong?
I will add when I run the batch file I get this.
setlocal EnableDelayedExpansion
for /f %%a in (filelist.txt) do (
set "cmd=findstr /R /N "^^" %%a | find /C ":""
for /f %%a in ('!cmd!') do set number=%%a
echo %number% >>countlist.txt
)