- @echo off
- setlocal ENABLEDELAYEDEXPANSION
- ::设置最大行数1000,可自己修改
- set max=100
- set /a max+=10000
- ::设置分隔符,默认"," 可自己修改
- set "fg=,"
- for %%a in (*.txt) do (
- (for /l %%b in (10000 1 %max%) do set /p #%%b=) <"%%~a"
- for /l %%b in (10000 1 %max%) do set "@%%b=!@%%b!%fg%!#%%b!"
- )
- ::默认输出CSV格式,用EXCEL打开,也可记事本打开
- (for /f "tokens=1* delims==" %%a in ('set @') do echo,%%b) > all.csv
复制代码
|