コマンドプロンプトfindstrによる正規表現でのテキスト検索

@echo off
chcp 65001

del data_marge_1st.txt
del data_marge_2nd.txt

set time2=%time: =0%

rem 「time」から切り出した数字をそれぞれ変数に代入
set hour=%time2:~0,2%
set minute=%time2:~3,2%

findstr /r ".*%date%.*" C:\Users\ya570\Desktop\export.txt | findstr /r /v ".*2回目.*" >> data_marge_1st.txt
findstr /r ".*%date%.*" C:\Users\ya570\Desktop\export_1.txt | findstr /r /v ".*2回目.*" >> data_marge_1st.txt
findstr /r ".*%date%.*" C:\Users\ya570\Desktop\export_2.txt | findstr /r /v ".*2回目.*" >> data_marge_1st.txt

findstr /r ".*%date%.*" C:\Users\ya570\Desktop\export.txt | findstr /r ".*2回目.*" >> data_marge_2nd.txt
findstr /r ".*%date%.*" C:\Users\ya570\Desktop\export_1.txt | findstr /r ".*2回目.*" >> data_marge_2nd.txt
findstr /r ".*%date%.*" C:\Users\ya570\Desktop\export_2.txt | findstr /r ".*2回目.*" >> data_marge_2nd.txt



for /F "usebackq delims=" %%a in (`type  data_marge_1st.txt ^| find /c /v "" `) do ( 

@echo %hour%時%minute%分現在、1回目検品終了%%a件です

)


for /F "usebackq delims=" %%b in (`type  data_marge_2nd.txt ^| find /c /v "" `) do ( 

@echo %hour%時%minute%分現在、2回目検品終了%%b件です

)

pause

この記事が気に入ったらサポートをしてみませんか?