I have been trying to create a batch file that will counts the amount of rows in several csv files and output that in a txt file. I have managed to figure out how to get the batch file to count the lines and put in a text file but I cannot find a way to get it to give the name of the file and how many lines are in the file like this..
file1.csv 100
file2.csv 112
All I manage to do is either get the rows from one file or it adds the rows from all the csv files and gives me a combined number.
This is the code I am trying to base my batch on..
@echo off
cls
setlocal EnableDelayedExpansion
set "cmd=findstr /R /N "^^" file.txt | find /C ":""
for /f %%a in ('!cmd!') do set number=%%a
echo %number% >>list.txt
I found it from here it's not my code How to count no of lines in text file and store the value into a variable using batch script? Then from there I have just been scouring the web for ideas