I'm combining hundreds of text files (phone memos in txt format) into one file. Many are only a handful of words long. I can do this easily enough with cat but there's no separator at all between the entries and it's a big mess, even using -n etc.
thanks
Cat command, quick recap
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
-
- Level 3
- Posts: 181
- Joined: Mon Mar 22, 2010 2:48 pm
Cat command, quick recap
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Cat command, quick recap
This topic has various ways to add a separator between files that you combine: http://superuser.com/questions/103530/how-can-one-join-files-with-seperating-data-in-bash. First answers uses sed magic instead of cat. Second answer captures the cat action in a loop, and adds a separator with the echo command.