I think you want a lookup table from file1: $1 is the lookup key and $2 the returned value.
Now you can test existence with (key in s) or get the value with s[key] or loop through the keys with for (key in s).
I think the following captures the wanted values in file2:
Note1: the target array as 3rd argument is an extension in GNU-awk. (Maybe you want to consider perl? Then it works on all platforms that have perl.)
Note2: for a most exact string match use a "border character". I have even prepended a ";" to the input string for match() in order to ensure it exists even at the beginning.
This User Gave Thanks to MadeInGermany For This Post:
Hi Friends,
I have a file with the following values..
xyz.txt,12345.xml
abc.txt,04567.xml
cde.txt,12134.xml
I would like to extract all the 2nd column values twice as shown in the example like
12345,12345.xml
04567,04567.xml
12134,12134.xml
Please advice!!
In the formus one of... (7 Replies)
I have read another post about this issue and am wondering how to adapt it
to my own, much simpler, issue.
I have a file of user IDs like so:
333333
321321
546465
...etc
I need to take each number and use it to print records wherein the 5th
field matches the user ID pulled from the... (2 Replies)
Hi everyone,
I have file1 and file2 comma separated both.
file1 is:
Header1,Header2,Header3,Header4,Header5,Header6,Header7,Header8,Header9,Header10
Code7,,,,,,,,,
Code5,,,,,,,,,
Code3,,,,,,,,,
Code9,,,,,,,,,
Code2,,,,,,,,,file2... (17 Replies)
Hello friends,
I have a text file with many columns (no. columns vary from row to row) separated by space. I need to collect all the values from 18th column to the end from each line and group them as pairs and then numbering like below..
1. 18th-col-value 19th-col-value 2. 20th-col-value ... (5 Replies)
In the below awk I am trying to print expName only if another tag planExecuted is true. In addition to the expName I am also printing planShortID. For some reason the word experiment gets printed so I remove it with sed. I have attached the complete index.html as well as included a sample of it... (1 Reply)
The below awk is used with the attached index.html and matches the specific user id in the sub portion with path of /rundb/api/v1/plugin/49/. The command does run but the output is blank. Something changed in the file structure as it used to work.
So using the first line in the output:
... (2 Replies)
I am trying to use awk to match the NM_ in file with $1 of id which is tab-delimited. The NM_ will always be in the line of file that starts with > and be after the second _. When there is a match between each NM_ and id, then the value of $2 in id is substituted or used to update the NM_. Each NM_... (3 Replies)
I am trying to use awk to find all the $2 values in file2 which is ~30MB and tab-delimited, that are between $2 and $3 in file1 which is ~2GB and tab-delimited.
I have just found out that I need to use $1 and $2 and $3 from file1 and $1 and $2of file2 must match $1 of file1 and be in the range... (6 Replies)
In the awk below which executes as is, I am trying to add a condition that will extract the text or
value after the FR= for the lines in each line of file1 compared
to file2. As is the lines between the two files are either a match, Missing in file 1, or Missing in file2,
but I can not add the... (1 Reply)
Discussion started by: cmccabe
1 Replies
LEARN ABOUT DEBIAN
ace::sequence::gene
Ace::Sequence::Gene(3pm) User Contributed Perl Documentation Ace::Sequence::Gene(3pm)NAME
Ace::Sequence::Gene - Simple "Gene" Object
SYNOPSIS
# open database connection and get an Ace::Object sequence
use Ace::Sequence;
# get a megabase from the middle of chromosome I
$seq = Ace::Sequence->new(-name => 'CHROMOSOME_I,
-db => $db,
-offset => 3_000_000,
-length => 1_000_000);
# get all the genes
@genes = $seq->genes;
# get the exons from the first one
@exons = $genes[0]->exons;
# get the introns
@introns = $genes[0]->introns
# get the CDSs (NOT IMPLEMENTED YET!)
@cds = $genes[0]->cds;
DESCRIPTION
Ace::Sequence::Gene is a subclass of Ace::Sequence::Feature. It inherits all the methods of Ace::Sequence::Feature, but adds the ability
to retrieve the annotated introns and exons of the gene.
OBJECT CREATION
You will not ordinarily create an Ace::Sequence::Gene object directly. Instead, objects will be created in response to a genes() call to
an Ace::Sequence object.
OBJECT METHODS
Most methods are inherited from Ace::Sequence::Feature. The following methods are also supported:
exons()
@exons = $gene->exons;
Return a list of Ace::Sequence::Feature objects corresponding to annotated exons.
introns()
@introns = $gene->introns;
Return a list of Ace::Sequence::Feature objects corresponding to annotated introns.
cds()
@cds = $gene->cds;
Return a list of Ace::Sequence::Feature objects corresponding to coding sequence. THIS IS NOT YET IMPLEMENTED.
relative()
$relative = $gene->relative;
$gene->relative(1);
This turns on and off relative coordinates. By default, the exons and intron features will be returned in the coordinate system used
by the gene. If relative() is set to a true value, then coordinates will be expressed as relative to the start of the gene. The first
exon will (usually) be 1.
SEE ALSO
Ace, Ace::Object, Ace::Sequence,Ace::Sequence::Homol, Ace::Sequence::Feature, Ace::Sequence::FeatureList, GFF
AUTHOR
Lincoln Stein <lstein@cshl.org> with extensive help from Jean Thierry-Mieg <mieg@kaa.crbm.cnrs-mop.fr>
Copyright (c) 1999, Lincoln D. Stein
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for
disclaimers of warranty.
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
Around line 148:
You forgot a '=back' before '=head1'
perl v5.14.2 2001-02-18 Ace::Sequence::Gene(3pm)