Created
July 2, 2018 20:15
-
-
Save fernandofig/a94bdab396457b0fc745e9be436f7277 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@REM !! ALTERE AS DUAS LINHAS ABAIXO PARA SE ADEQUAR SUAS NECESSIDADES !! | |
@SET "SEG=PE1" | |
@SET "EXT=txt" | |
@REM ******** NAO ALTERE NADA DAQUI PRA BAIXO! ******** | |
@ECHO OFF | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
FOR /R %%G IN (*.%EXT%) DO ( | |
REM ECHO %%G | |
FOR %%F IN ("%%G") DO ( SET "CARQ=%%~dF%%~pF" ) | |
SET "NARQ=%%~nxG" | |
SET CNT=0 | |
FOR /F %%C IN ('FIND /C "%SEG%" ^< "%%G"') DO ( SET CNT=%%C ) | |
echo !NARQ!;!CNT! >> !CARQ!report.csv | |
) | |
ECHO CONCLUIDO! | |
PAUSE > NUL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment