The following 44 words could not be found in the dictionary of 615 words (including 615 LocalSpellingWords) and are highlighted below:

ac1   ac2   and   arrange   at   awk   based   be   between   cat   chr   Chr1   common   comparison   cust1   cust2   falls   field   file   File1   File2   files   for   if   in   input   Join   join   key   location   locations   need   next   on   Outfile   output   re   script   shell   sorted   the   to   two   Using  

Clear message

Join two files on a common field and re-arrange the output:

$ cat a.txt
cust1, ac1, 100
cust2, ac2, 200
$ cat b.txt
100000, cust1, 100
2000000, cust2, 200
$ join -a 1 -a 2 -1 3 -2 3 -t"," -o 1.1 1.2 1.3 2.1 a.txt b.txt
cust1, ac1, 100,100000
cust2, ac2, 200,2000000

the input files need to be sorted based on the comparison key

Using awk in a shell script

File1 = chr locations
File2 = GFF file

awk '
NR==FNR{
a[NR]=$0
next
}
{
for(i=1;i<NR;i++)
if (a[i] > $4 && a[i] < $5) print $2,$3, "falls between", $4 "and", $5 "at location", a[i]
}
' File1 File2 > Outfile_Chr1 &

JoinFiles (last edited 2009-08-30 04:37:31 by ChrisSeidel)