本帖最后由 aloha20200628 于 2024-5-15 17:28 编辑
回复 31# 娜美
管道是效率大杀器尤其是对大数据,尽量不用...
- @echo off &setlocal &del /q "allinOne.txt" "bug.txt" 2>nul
- for /f "delims=" %%F in (b.txt) do if not exist "%%~F" (echo,"badFile -- %%F"&echo,%%F>>"bug.txt") else (
- for /f "tokens=1 delims=_" %%a in (' coder.exe -s -a gc -f "%%~F" ') do (
- echo, /// %%~F ///>>"allinOne.txt"
- if /i "%%a"=="utf-8" (
- powershell "$s=gc '%%~F' readcount 1000 -enc 'utf8';ac 'allinOne.txt' $s"
- ) else if /i "%%a"=="utf-16" (
- powershell "$s=gc '%%~F' readcount 1000 -enc 'unicode';ac 'allinOne.txt' $s"
- ) else if /i "%%a"=="ansi" (more "%%~F">>"allinOne.txt")
- )
- echo,>>"allinOne.txt"
- )
- endlocal&pause&exit/b
复制代码
|