Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要帮助创建一个将制表符分隔的文件转换为 csv 的批处理文件。我有 4 个单独的文件,用制表符分隔,我需要是 csv。
从你提供的少量数据来看,
@ECHO OFF SETLOCAL ( FOR /f "delims=" %%i IN (tdf.txt) DO ( SET line=%%i SETLOCAL enabledelayedexpansion ECHO(!line: =,! endlocal ) ) >csv.txt
这应该可以完成这项工作。
问题的关键在于将ECHO所有制表符(冒号后的字符)更改为逗号(后的字符串)从旧=文件生成新文件的行csv.txttdf.txt
ECHO
=
csv.txt
tdf.txt