Count the number of lines in a file
Solved
Ka-El
Posted messages
279
Status
Member
-
Ka-el -
Ka-el -
Hello,
I have a file with a certain number of lines.
I would like to know the command that will allow me to find out how many lines the file has.
In Unix, I would of course use the command "wc -l", but in batch, I cannot find an equivalent...
For now, I have tried this:
set /a compt=0
for /f "delims=" %%i in ('type %Fichiers_plein_de_lignes%') do (
set /a compt+=1
echo !compt!>> %résultat%
)
But in the result file, each line is counted while I need the total sum of the lines.
Does anyone have an idea?
Thank you in advance for your help.
Ka-el
I have a file with a certain number of lines.
I would like to know the command that will allow me to find out how many lines the file has.
In Unix, I would of course use the command "wc -l", but in batch, I cannot find an equivalent...
For now, I have tried this:
set /a compt=0
for /f "delims=" %%i in ('type %Fichiers_plein_de_lignes%') do (
set /a compt+=1
echo !compt!>> %résultat%
)
But in the result file, each line is counted while I need the total sum of the lines.
Does anyone have an idea?
Thank you in advance for your help.
Ka-el