Search Results

Search: Posts Made By: roussine
2,744
Posted By rdrtx1
awk '{while (match($0,...
awk '{while (match($0, /)[0-9].[0-9][0-9][0-9]:/)) {s=substr($0, RSTART+1, RLENGTH-2); r=int(100*s); if (r>100) r="error"; gsub(")" s ":", ")" r ":")}} 1' infile
2,353
Posted By rdcwayx
awk ' NR==FNR{a[$1]=0;next} {for (i in a)...
awk '
NR==FNR{a[$1]=0;next}
{for (i in a) {s=match($0,i);if (s>0) a[i]++}}
END {for (i in a) print i,a[i]}
' name_list input.txt

SALINISPORA 2
PROPIONIBACTERIUM 1
RHODOCOCCUS 1
AZORHIZOBIUM...
8,119
Posted By konsolebox
Maybe it's also safer to include underscore: ...
Maybe it's also safer to include underscore:
awk 'NR==FNR{a[$1 "_"]=$2 "_";next}{ for (i in a) gsub(i,a[i])}1' template.txt input.txt
Although the 1st and 3rd parts are in different forms: AAAA0 to...
8,119
Posted By rdcwayx
If the template file (replacement table) has 100...
If the template file (replacement table) has 100 lines, above sed or perl commands will be long to fill the whole web pages.:)

$ cat template.txt
ACICJ ACIDIPHILIUM
ACIF2 ACIDITHIOBACILLUS...
Showing results 1 to 4 of 4

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