回复 4# gddsssko
我找到原因了,没有对 文本中的引号做处理。- @echo off
- chcp 65001 >nul
- cd /d "%~dp0"
- (for /r %%i in (*.txt) do (
- set str="%%~ni"
- for /f "tokens=1* delims=[]" %%a in ('find /n /v "" ^<"%%i"') do (
- set line=%%b
- setlocal enabledelayedexpansion
- if "!line!" neq "" (
- set "line=!line:"=""!"
- )
- for /f "delims=" %%x in ("!str!,"!line!"") do (
- endlocal
- set "str=%%x"
- )
- )
- setlocal enabledelayedexpansion
- echo=!str!
- endlocal
- ))>out.csv
- pause
复制代码
|