Search Results

Search: Posts Made By: heecha
1,682
Posted By Corona688
That's why I saved $0 in K: awk 'NR==FNR {...
That's why I saved $0 in K: awk 'NR==FNR { K[$1,$2,$3]=$0; next } ($1,$2,$3) in K { print $0, K[$1,$2,$3] }' a b
1,682
Posted By radoulov
Just for your info, ($1 SUBSEP $2 SUBSEP...
Just for your info,

($1 SUBSEP $2 SUBSEP $3) and

($1, $2, $3)are equivalent.

So you could use:
($1, $2, $3) in K
1,682
Posted By Corona688
You can use the NR==FNR trick to avoid needing...
You can use the NR==FNR trick to avoid needing your own read-loop for the first file. FNR is the line number in the file, NR is the total number of lines; they are only the same when you're reading...
3,078
Posted By EAGL€
Alister's solution sure simpliest and better but...
Alister's solution sure simpliest and better but if you want to do it with awk then using different seperator rather than "A" cold be better i guess:
echo...
3,078
Posted By dude2cool
Try this one liner awk, see if it helps: ...
Try this one liner awk, see if it helps:

echo "m110730_101608_00120_c100168052554400000315046108261127_s1_p0/7/29_426ACGTGCTATGCGG"|awk -F'A' '{print $1 " " "A" $2 $3}'

---------- Post updated...
3,078
Posted By alister
You can't expect characters that are used to...
You can't expect characters that are used to split a string to be part of the result. If you split "1,2,3,4" on the comma, by definition the comma is not an allowed member of a field. Same goes...
5,940
Posted By yazu
Not tested: printf( "%s\t%s\n", k2rec[key,i],...
Not tested:
printf( "%s\t%s\n", k2rec[key,i], $0) > k2rec[key,i]
4,736
Posted By agama
The short answer is to process f2 first, then...
The short answer is to process f2 first, then process f1. This will reduce your memory footprint as you'll only save 68 things in a[] rather than 48K things.

The long answer is to be a bit more...
5,217
Posted By ctsgnb
<42MLN.3.bedS2 xargs -i grep {} testRef2or ...
<42MLN.3.bedS2 xargs -i grep {} testRef2or
<42MLN.3.bedS2 xargs -I{} grep {} testRef2# cat f3
13208
13208
13360
13363
13484
13518
13518
# cat f2
A1BG - 13208 13284
AAA1 - ...
5,217
Posted By rdcwayx
awk 'NR==FNR{a[NR]=$1;s=NR;next} {for...
awk 'NR==FNR{a[NR]=$1;s=NR;next}
{for (i=1;i<=s;i++) if (a[i]>=$3&&a[i]<=$4) {print a[i] "\t" $0}}' 42MLN.3.bedS2 testRef2

13208 A1BG - 13208 13284
13208 A1BG - 13208 ...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 07:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy