Concatenating Files And Insert New Line In Between Files

前端 未结 7 1914
旧时难觅i
旧时难觅i 2020-11-29 16:48

I have multiple files which I want to concat with cat. Let\'s say

File1.txt 
foo

File2.txt
bar

File3.txt
qux

I want to conc

7条回答
  •  悲哀的现实
    2020-11-29 17:04

    That's how I just did it on OsX 10.10.3

    for f in *.txt; do (cat $f; echo '') >> fullData.txt; done
    

    since the simple 'echo' command with no params ended up in no new lines inserted.

提交回复
热议问题