Shell UNIX在.txt文件中迭代,并按行将它们合并到单个文件中
假设我在UNIX shell上有3个不同的.txt文件。我想把不同的文件合并成一个文件。我还需要创建该文件并逐行写入 以以下为例: file1.txt: -abc -def -ghi file2.txt: -123 -456 -789 file3.txt: -*** -^^^ -' 我需要以以下格式写入并保存组合文件: combinedFile.txt abc 123*** def 456^^^ ghi 789´´´切割,示例:Shell UNIX在.txt文件中迭代,并按行将它们合并到单个文件中,shell,file,unix,merge,iteration,Shell,File,Unix,Merge,Iteration,假设我在UNIX shell上有3个不同的.txt文件。我想把不同的文件合并成一个文件。我还需要创建该文件并逐行写入 以以下为例: file1.txt: -abc -def -ghi file2.txt: -123 -456 -789 file3.txt: -*** -^^^ -' 我需要以以下格式写入并保存组合文件: combinedFile.txt abc 123*** def 456^^^ ghi 789´´´切割,示例: cut -d- -f2 file1 > file11 pa
cut -d- -f2 file1 > file11
paste -d' ' file11 file22 file33
粘贴,例如:
cut -d- -f2 file1 > file11
paste -d' ' file11 file22 file33
人工粘贴
。。。