Thursday, November 13, 2008

Join lines of two lines

I want to join the lines of two files. So I have file1:

A
B
C
D
E
F


and file 2:

G
H
I
J
K
L


and get:

AG
BH
CI
DJ
EK
FL


Use awk like this (robbed and modified from various places on the internet):

awk '{str = $0 ; getline < "run1717_1731_1.end2.pf.fastq" ; print str $0 > "run1717_1731_1_joined.fastq"}' run1717_1731_1.end1.pf.fastq

No comments: