Cat command, quick recap

Forum rules
Before you post please read how to get help
nathanjh13
Level 3
Level 3
Posts: 176
Joined: Mon Mar 22, 2010 2:48 pm

Cat command, quick recap

Postby nathanjh13 » Tue Aug 20, 2013 6:17 pm

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

User avatar
xenopeek
Level 23
Level 23
Posts: 19260
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Cat command, quick recap

Postby xenopeek » Wed Aug 21, 2013 1:27 am

This topic has various ways to add a separator between files that you combine: http://superuser.com/questions/103530/h ... ta-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.
Image


Return to “Scripts & Bash”

Who is online

Users browsing this forum: No registered users and 0 guests