Sponsored Content
Full Discussion: Concatenate files by pairs
Top Forums UNIX for Dummies Questions & Answers Concatenate files by pairs Post 302946659 by jawad on Thursday 11th of June 2015 05:15:29 AM
Old 06-11-2015
Concatenate files by pairs

Hi,
I would like to batch concatenate files by pairs. I have quite a few of them so I would not like to do that pair by pair separately.
the names of the file is of the type:

Code:
file1.fastq 
newfile1_new.fastq 
file2.fastq 
newfile2_new.fastq 
and so on...

I would like to concatenate file1 and newfile1 together etc...
Any idea how I could script that in shell commands?
Thanks a lot for your help!!

Last edited by Scrutinizer; 06-11-2015 at 07:41 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

concatenate lines in pairs

Hi, I have a text file with the following contents /C=IT/O=INFN/OU=Personal Certificate/L=Napoli/CN=Some guy /C=IT/O=INFN/CN=INFN CA /O=Grid/O=NorduGrid/OU=uninett.no/CN=Another guy /O=Grid/O=NorduGrid/CN=NorduGrid Certification Authority /C=TW/O=AP/OU=GRID/CN=Someone else... (5 Replies)
Discussion started by: kerl
5 Replies

2. Shell Programming and Scripting

Concatenate files

I have directory structure sales_only under which i have multiple directories for each dealer example: ../../../Sales_Only/xxx_Dealer ../../../Sales_Only/yyy_Dealer ../../../Sales_Only/zzz_Dealer Every day i have one file produce under each directory when the process runs. The requirement... (3 Replies)
Discussion started by: mohanmuthu
3 Replies

3. Shell Programming and Scripting

Concatenate files

Hi, I want to create a batch(bash) file to combine 23 files together. These files have the same extension. I want the final file is save to a given folder. Once it is done it will delete the 23 files. Thanks for help. Need script. (6 Replies)
Discussion started by: zhshqzyc
6 Replies

4. UNIX Desktop Questions & Answers

trying to cat multiple pairs of files

I have a number of files in a directory named like this: fooP1, fooN1, fooP2, fooN2 ... fooP(i), fooN(i). I'd like to know how to combine each P and N pair into a single file, foo(i) TIA John Balwit (1 Reply)
Discussion started by: balwit
1 Replies

5. Shell Programming and Scripting

Concatenate files

I have a file named "file1" which has the following data 10000 20000 30000 And I have a file named "file2" which has the following data ABC DEF XYZ My output should be 10000ABC 20000DEF (3 Replies)
Discussion started by: bobby1015
3 Replies

6. UNIX for Dummies Questions & Answers

Concatenate Several Files to One

Hi All, Need your help. I will need to concatenate around 100 files but each end of the file I will need to insert my name DIRT1228 on each of the file and before the next file is added and arrived with just one file for all the 100files. Appreciate your time. Dirt (6 Replies)
Discussion started by: dirt1228
6 Replies

7. UNIX for Dummies Questions & Answers

Concatenate files

Hi I am trying to learn linux step by step an i am wondering can i use cat command for concatenate files but i want to place context of file1 to a specific position in file2 place of file 2 and not at the end as it dose on default? Thank you. (3 Replies)
Discussion started by: iliya24
3 Replies

8. UNIX for Dummies Questions & Answers

Concatenate files and delete source files. Also have to add a comment.

- Concatenate files and delete source files. Also have to add a comment. - I need to concatenate 3 files which have the same characters in the beginning and have to remove those files and add a comment and the end. Example: cat REJ_FILE_ABC.txt REJ_FILE_XYZ.txt REJ_FILE_PQR.txt >... (0 Replies)
Discussion started by: eskay
0 Replies

9. Shell Programming and Scripting

Looping through pairs of files with awk

Hi all, please help me construct the command. i want to loop through all files named bam* and bed*. My awk works for a particular pair but there are too many pairs to do manually. I have generated multiple files in a folder in a given pattern. The files are named like bam_fixed1.bam... (2 Replies)
Discussion started by: newbie83
2 Replies

10. Shell Programming and Scripting

Looping through files in pairs

Hi all, Please guide. It has to do with parsing the input file names. I have a fairly large number of files, I want to do some operations on them in a pairwise fashion (every file has a pair). The names are in the following pattern, with the pairs of files named with _1 and _2 , the... (4 Replies)
Discussion started by: newbie83
4 Replies
Bio::Index::Fastq(3pm)					User Contributed Perl Documentation				    Bio::Index::Fastq(3pm)

NAME
Bio::Index::Fastq - Interface for indexing (multiple) fastq files SYNOPSIS
# Complete code for making an index for several # fastq files use Bio::Index::Fastq; use strict; my $Index_File_Name = shift; my $inx = Bio::Index::Fastq->new( '-filename' => $Index_File_Name, '-write_flag' => 1); $inx->make_index(@ARGV); # Print out several sequences present in the index # in Fastq format use Bio::Index::Fastq; use strict; my $Index_File_Name = shift; my $inx = Bio::Index::Fastq->new('-filename' => $Index_File_Name); my $out = Bio::SeqIO->new('-format' => 'Fastq','-fh' => *STDOUT); foreach my $id (@ARGV) { my $seq = $inx->fetch($id); # Returns Bio::Seq::Quality object $out->write_seq($seq); } # or, alternatively my $id; my $seq = $inx->get_Seq_by_id($id); #identical to fetch DESCRIPTION
Inherits functions for managing dbm files from Bio::Index::Abstract.pm, and provides the basic funtionallity for indexing fastq files, and retrieving the sequence from them. Note: for best results 'use strict'. Bio::Index::Fastq supports the Bio::DB::BioSeqI interface, meaning it can be used as a Sequence database for other parts of bioperl FEED_BACK Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Tony Cox Email - avc@sanger.ac.uk APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ _file_format Title : _file_format Function: The file format for this package, which is needed by the SeqIO system when reading the sequence. Returns : 'Fastq' _index_file Title : _index_file Usage : $index->_index_file( $file_name, $i ) Function: Specialist function to index FASTQ format files. Is provided with a filename and an integer by make_index in its SUPER class. Example : Returns : Args : id_parser Title : id_parser Usage : $index->id_parser( CODE ) Function: Stores or returns the code used by record_id to parse the ID for record from a string. Useful for (for instance) specifying a different parser for different flavours of FASTQ file. Returns &default_id_parser (see below) if not set. If you supply your own id_parser subroutine, then it should expect a fastq description line. An entry will be added to the index for each string in the list returned. Example : $index->id_parser( &my_id_parser ) Returns : ref to CODE if called without arguments Args : CODE default_id_parser Title : default_id_parser Usage : $id = default_id_parser( $header ) Function: The default Fastq ID parser for Fastq.pm Returns $1 from applying the regexp /^>s*(S+)/ to $header. Returns : ID string Args : a fastq header line string perl v5.14.2 2012-03-02 Bio::Index::Fastq(3pm)
All times are GMT -4. The time now is 08:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy