Cat command, quick recap

Forum rules
Before you post please read this

Cat command, quick recap

Postby nathanjh13 on 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
nathanjh13
Level 3
Level 3
 
Posts: 149
Joined: Mon Mar 22, 2010 2:48 pm

Linux Mint is funded by ads and donations.
 

Re: Cat command, quick recap

Postby xenopeek on 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.
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14720
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 3 guests