我编写了一个脚本,将位置中的所有csv文件合并到txt。合并工作正常,似乎添加了一个 - >在最后一行数据之后。无论如何都要阻止这条额外的线被包含或移除
@echo off
setlocal enabledelayedexpansion
if exist "C:\DND\tempfile.txt" (del /Q "C:\DND\tempfile.txt")
copy "\\jarvisFS1\Groups\InforIFC\Payroll\New\*.csv" "C:\DND\tempfile.txt"
for /f "delims=" %%f in (C:\DND\tempfile.txt) do (
set var=%%f"
set var=!var:"=!
set var=!var:,= !
echo !var! >> "C:\DND\EPRO.txt"
)
del /Q "C:\DND\Tempfile.txt"
Move "C:\DND\EPRO.txt" "\\jupiterinfor\Import Master\IM_Files"
Move "\\jarvisfs1\groups\InforIFC\Payroll\NEW\*.csv"
"\\jarvisfs1\groups\InforIFC\Payroll\PROCESSED"
我附了一个屏幕截图
屏幕截图