Cat command, quick recap

Forum rules
Before you post please read how to get help

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.

Level 3
Level 3
Posts: 173
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: ... 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
Level 23
Level 23
Posts: 18200
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 1 guest