Sponsored Content
Full Discussion: Concatenate files by pairs
Top Forums UNIX for Dummies Questions & Answers Concatenate files by pairs Post 302946669 by RudiC on Thursday 11th of June 2015 06:40:11 AM
Old 06-11-2015
Please use code tags as required by forum rules!

That spec is utterly sparse. Please be aware that the better the spec the better the solutions.

For EXACTLY above sample structure, try
Code:
for i in ?????.fastq; do cat $i *${i%.*}_*; done

Redirect to taste.
These 2 Users Gave Thanks to RudiC For This Post:
 

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
checknr(1)							   User Commands							checknr(1)

NAME
checknr - check nroff and troff input files; report possible errors SYNOPSIS
checknr [-fs] [-a . x1 . y1 . x2 . y2 ... .xn .yn] [-c . x1 . x2 . x3 ... .xn] [filename]... DESCRIPTION
checknr checks a list of nroff(1) or troff(1) input files for certain kinds of errors involving mismatched opening and closing delimiters and unknown commands. If no files are specified, checknr checks the standard input. Delimiters checked are: o Font changes using fx ... fP. o Size changes using sx ... s0. o Macros that come in open ... close forms, for example, the .TS and .TE macros which must always come in pairs. checknr knows about the ms(5) and me(5) macro packages. checknr is intended to be used on documents that are prepared with checknr in mind. It expects a certain document writing style for f and s commands, in that each fx must be terminated with fP and each sx must be terminated with s0. While it will work to directly go into the next font or explicitly specify the original font or point size, and many existing documents actually do this, such a practice will produce complaints from checknr. Since it is probably better to use the fP and s0 forms anyway, you should think of this as a contribu- tion to your document preparation style. OPTIONS
-f Ignore f font changes. -s Ignore s size changes. -a .x1 .y1... Add pairs of macros to the list. The pairs of macros are assumed to be those (such as .DS and .DE) that should be checked for balance. The -a option must be followed by groups of six characters, each group defining a pair of macros. The six characters are a period, the first macro name, another period, and the second macro name. For exam- ple, to define a pair .BS and .ES, use `-a.BS.ES' -c .x1... Define commands which checknr would otherwise complain about as undefined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWdoc | +-----------------------------+-----------------------------+ SEE ALSO
eqn(1), nroff(1), troff(1), attributes(5), me(5), ms(5) BUGS
There is no way to define a one-character macro name using the -a option. SunOS 5.11 14 Sep 1992 checknr(1)
All times are GMT -4. The time now is 08:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy