Search Results

Search: Posts Made By: loba
1,756
Posted By Don Cragun
Assuming that you have files...
Assuming that you have files item_at_position[789].list containing valid values for each of those fields (one value per line), such as:
item_at_position7.list:
aa1
aa2
aa3
aa4...
1,756
Posted By tukuyomi
Nothing fancy in the below script, just an...
Nothing fancy in the below script, just an all-in-one task:
awk '{$10=$7;$7=$8=$9="na"}
$10~/aa1/{$7="aa1"}
$10~/ab2/{$8="ab2"}
$10~/ac3/{$9="ac3"}
1' input_file > output_file
1,708
Posted By birei
Hi, Using 'perl': $ cat infile ...
Hi,

Using 'perl':

$ cat infile
>H1_A1_A2_A3_A4_ID1_A5
A:B:C:S:E:E:K
>H2_A1_A2_A3_ID2_A5
A:B:C:S:E:E:K
D:E:G
>H3_A1_A2_A3_ID5_A5
A:B:S:R:E:K
D:E
$ cat script.pl
use warnings;
use...
1,708
Posted By dude2cool
Another one: gawk -F";" 'NR==FNR{a[$1]=$1"...
Another one:

gawk -F";" 'NR==FNR{a[$1]=$1" "$2" "$3;next} {for(ID in a){if($0~ID)print $0, a[ID]}} $0!~">.*"{print $0}' comments.txt File.txt
1,708
Posted By bartus11
Try: awk 'NR==FNR{gsub(";","...
Try: awk 'NR==FNR{gsub(";"," ");a[$1]=$0;next}/^>/{x=$0;sub(".*_ID","ID",x);sub("_.*","",x);$0=$0" "a[x]}1' comments.txt File.txt
Showing results 1 to 5 of 5

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