GNU bug report logs - #22001
Is it possible to tab separate concatenated files?

Previous Next

Package: coreutils;

Reported by: "Macdonald, Kim - BCCDC" <kim.macdonald <at> bccdc.ca>

Date: Mon, 23 Nov 2015 21:03:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Macdonald, Kim - BCCDC" <kim.macdonald <at> bccdc.ca>
To: 'Assaf Gordon' <assafgordon <at> gmail.com>, "22001 <at> debbugs.gnu.org" <22001 <at> debbugs.gnu.org>
Subject: bug#22001: Is it possible to tab separate concatenated files?
Date: Mon, 23 Nov 2015 14:52:52 -0800
Thanks Assaf, 

Sorry for the confusion - I wanted to add a tab (or even a new line) after each file that was concatenated. Actually a new line may be better. 

For Example:
Concatenate the files like so:
>gi|452742846|ref|NZ_CAFD010000001.1| Salmonella enterica subsp., whole genome shotgun sequenceTTTCAGCATATATATAGGCCATCATACATAGCCATATAT
>gi|452742846|ref|NZ_CAFD010000002.1| Salmonella enterica subsp., whole genome shotgun sequenceCATAGCCATATATACTAGCTGACTGACGTCGCAGCTGGTCAGACTGACGTACGTCGACTGACGTC
>gi|452742846|ref|NZ_CAFD010000003.1| Salmonella enterica subsp., whole genome shotgun sequenceTATATAGATACATATATCGCGATATCAGACTGCATAGCGTCAG

Right now - Just using cat, they look , like:
>gi|452742846|ref|NZ_CAFD010000001.1| Salmonella enterica subsp., whole genome shotgun sequenceTTTCAGCATATATATAGGCCATCATACATAGCCATATAT>gi|452742846|ref|NZ_CAFD010000002.1| Salmonella enterica subsp., whole genome shotgun sequenceCATAGCCATATATACTAGCTGACTGACGTCGCAGCTGGTCAGACTGACGTACGTCGACTGACGTC>gi|452742846|ref|NZ_CAFD010000003.1| Salmonella enterica subsp., whole genome shotgun sequenceTATATAGATACATATATCGCGATATCAGACTGCATAGCGTCAG


Kim



-----Original Message-----
From: Assaf Gordon [mailto:assafgordon <at> gmail.com] 
Sent: November 23, 2015 2:03 PM
To: Macdonald, Kim - BCCDC; 22001 <at> debbugs.gnu.org
Subject: Re: bug#22001: Is it possible to tab separate concatenated files?

tag 22001 notabug
close 22001
stop

Hello Kim,

On 11/23/2015 03:50 PM, Macdonald, Kim - BCCDC wrote:
> I'm just looking at the options for the cat command - I see there's a 
> way to ignore tabs when they exist - but is there a way to tab 
> separate the files you're concatenating with the cat command?

It is unclear (to me) what you're trying to achieve - could provide a bit more details (perhaps a short example) ?

If you have a file (one file) with spaces and you wish to convert them to tabs, consider the 'expand' command (then pipe to 'cat' if needed).

If you have multiple files and you wish to print them side-by-side, separated by tabs (as opposed to one-after-the-other, as with 'cat'), consider using 'paste':

   $ cat 1.txt
   a
   b
   c
   d

   $ cat 2.txt
   1
   2
   3
   4

   $ cat 3.txt
   w
   x
   y
   z

   $ paste 1.txt 2.txt 3.txt
   a	1	w
   b	2	x
   c	3	y
   d	4	z

regards,
  - assaf





This bug report was last modified 6 years and 213 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.