我已经从各个地方复制了以下代码的内容,并试图将其修剪下来,它可以工作,但是在我将它从BAT转换为EXE后,它变得非常缓慢。我可能会补充一点,我对此非常新,以及解决方案是非常感谢的解释。
@echo off
setlocal enabledelayedexpansion
for %%F in (*.txt) do (
set /p .=Processing [%%~F] ... <nu1
set "firstline="
(for /f "tokens=* usebackq" %%a in ("%%~nxf") do (
if not defined firstline (
set firstline=%%a
echo !firstline:"=!
) else (
echo %%a
)
))>"%%~nF.csv"
echo [%%~nF.csv]
)
@echo off
del *.txt
@echo off
for /F %%i in ('dir /B /O:-D *.csv') do (
call :open "%%i"
exit /B 0
)
:open
start "dummy" "%~1"
exit /B 0