使用批处理文件将标题添加到CSV
问题描述:
我有一个CSV文件,其中包含需要添加标题的数据.我希望它看起来像这样
I have a CSV file that has data that I need to add headers to. I want it to look like this
group id firstname lastname homephone
acme 1 joe moe 555555555
当前看起来像这样
acme 1 joe moe 5555555555
任何帮助将不胜感激.
答
@echo off
echo group id firstname lastname homephone > new.csv
type old.csv >> new.csv
Type命令不适用于unicode符号,但是如果您的文件仅包含ascii-ies,则应该可以.
Type command does not work good with unicode symbols , but this should be ok if your file contains only ascii-ies.