Board logo

标题: [求助]合并大量TXT或者CSV 文件 [打印本页]

作者: chrish     时间: 2011-1-15 00:00    标题: [求助]合并大量TXT或者CSV 文件

各位大侠:

手上有大量的txt或者csv文件需要合并,文件格式如1.txt和2.txt。。。。。, 他们的文件标题是一样的,需要合并成result.txt的格式。就是所有文件连接起来,但从第二个文件开始不要标题。

我用copy 1.txt+2.txt+。。。 result.txt命令,但是输出后包含了标题;如果用more 命令,但处理时间很长,请问各位大侠有没有好的办法,谢谢了~~

输入:
1.txt
AAA,BBB,CCC
1,1,1
2,2,2
3,3,3

2.txt
AAA,BBB,CCC
4,4,4
5,5,5
6,6,7

3.txt
。。。
。。。

输出:
result.txt
AAA,BBB,CCC
1,1,1
2,2,2
3,3,3
4,4,4
5,5,5
6,6,6
。。。
作者: xyz1234111     时间: 2011-1-15 12:50
copy **.txt result.txt
作者: fsfss     时间: 2011-1-15 15:54
(sed 1q 1.txt&sed -s 1d *.txt)>result.txt
作者: chrish     时间: 2011-1-16 07:38


  Quote:
Originally posted by fsfss at 2011-1-15 15:54:
(sed 1q 1.txt&sed -s 1d *.txt)>result.txt

谢谢~ 可执行时提示SED  不是内部命令,请问怎么处理啊?
作者: cyn01livecn     时间: 2011-1-16 16:00
用这个命令之后再运行:
============================
path=C:\windows\system32;C:\windows;C:\windows\System32\Wbem;
============================
作者: chrish     时间: 2011-1-17 20:04
还是不行呢。
请问是这个两个命令吗:

path=C:\windows\system32;C:\windows;C:\windows\System32\Wbem;
(sed 1q 1.txt&sed -s 1d *.txt)>result.txt
作者: fsfss     时间: 2011-1-18 16:38
置顶贴   批处理室附件收集专用帖[2009-02-11]
作者: chrish     时间: 2011-1-20 03:10
但是还是不行啊,请大侠帮忙啊,多谢了~~~~~`
情况有点紧急~~~~~~
作者: LH521     时间: 2018-5-26 18:20
新手等待高手入内