06-29-2007
column based search
Hi,
I need to search one file based on the entry from another;
eg.
file1 has entries;
45654
34768
12345
File2 has entries
23234 somestring 4312
45654 somestring 34768
12345 somestring 45654
so I need to pick first entry in file1 which eg. '45654' and search for this entry only in 'column 1' of File2. Then save the 3rd entry (column 3) from the same line to a variable. (to be used later).
Any help would be appreciated.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All,
I need to select only those records having a non zero record in the first column of a comma delimited file.
Suppose my input file is having data like:
"0","01/08/2005 07:11:15",1,1,"Created",,"01/08/2005"
"0","01/08/2005 07:12:40",1,1,"Created",,"01/08/2005"... (2 Replies)
Discussion started by: shashi_kiran_v
2 Replies
2. Shell Programming and Scripting
Given a file such as this I need to remove the duplicates.
00060011 PAUL BOWSTEIN ad_waq3_921_20100826_010517.txt
00060011 PAUL BOWSTEIN ad_waq3_921_20100827_010528.txt
0624-01 RUT CORPORATION ad_sade3_10_20100827_010528.txt
0624-01 RUT CORPORATION ... (13 Replies)
Discussion started by: script_op2a
13 Replies
3. Shell Programming and Scripting
Hi All,
I have following html code
<TR><TD>9</TD><TD>AR_TVR_TBS </TD><TD>85000</TD><TD>39938</TD><TD>54212</TD><TD>46</TD></TR>
<TR><TD>10</TD><TD>ASCV_SMY_TBS </TD><TD>69880</TD><TD>33316</TD><TD>45698</TD><TD>47</TD></TR>
<TR><TD>11</TD><TD>ARC_TBS ... (9 Replies)
Discussion started by: ckwan
9 Replies
4. Shell Programming and Scripting
Hi,
I have a file like this
ACC 2 2 21 aaa
AC 443 3 22 aaa
GCT 76 1 33 xxx
TCG 34 2 33 aaa
ACGT 33 1 22 ggg
TTC 99 3 44 wee
CCA 33 2 33 ggg
AAC 1 3 55 ddd
TTG 10 1 22 ddd
TTGC 98 3 22 ddd
GCT 23 1 21 sds
GTC 23 4 32 sds
ACGT 32 2 33 vvv
CGT 11 2 33 eee
CCC 87 2 44... (1 Reply)
Discussion started by: polsum
1 Replies
5. Shell Programming and Scripting
Dear All,
I have input file like this.
input.txt
CE2_12-15 3950.00 589221.0 9849709.0 768.0 CE2_12_2012
CE2_12-15 3949.00 589199.0 9849721.0 768.0 CE2_12_2012
CE2_12-15 3948.00 589178.0 9849734.0 768.0 CE2_12_2012
CE2_12-52 1157.00 ... (3 Replies)
Discussion started by: attila
3 Replies
6. Shell Programming and Scripting
Hi,
I have a similar input format-
A_1 2
B_0 4
A_1 1
B_2 5
A_4 1
and looking to print in this output format with headers. can you suggest in awk?awk because i am doing some pattern matching from parent file to print column 1 of my input using awk already.Thanks!
letter number_of_letters... (5 Replies)
Discussion started by: prashob123
5 Replies
7. Shell Programming and Scripting
Hi,
I have a table to be imported for R as matrix or data.frame but I first need to edit it because I've got several lines with the same identifier (1st column), so I want to sum the each column (2nd -nth) of each identifier (1st column)
The input is for example, after sorted:
K00001 1 1 4 3... (8 Replies)
Discussion started by: sargotrons
8 Replies
8. Shell Programming and Scripting
Hello everyone,
I am using ksh on Solaris 10 and I'm gathering data in a CSV file that looks like this:
20170628-23:25:01,1,0,0,1,1,1,1,55,55,1
20170628-23:30:01,1,0,0,1,1,1,1,56,56,1
20170628-23:35:00,1,0,0,1,1,2,1,57,57,2
20170628-23:40:00,1,0,0,1,1,1,1,58,58,2... (6 Replies)
Discussion started by: ejianu
6 Replies
9. Shell Programming and Scripting
Experts,
Need your support for this awk script.
we have only one input file, all these column 1 and column 2 are in same file and have to do lookup for values in one file(column1 and column2) but output we need in another file
Need to grep row whose string contains 9K from column 1. When found... (6 Replies)
Discussion started by: as7951
6 Replies
10. UNIX for Beginners Questions & Answers
Hi All ,
I am having an input file as stated below
Input file
6 ddk/djhdj/djhdj/Q 10 0.5
dhd/jdjd.djd.nd/QB 01 0.5
hdhd/jd/jd/jdj/Q 10 0.5
512 hd/hdh/gdh/Q 01 0.5
jdjd/jd/ud/j/QB 10 0.5
HD/jsj/djd/Q 01 0.5
71 hdh/jjd/dj/jd/Q 10 0.5
... (5 Replies)
Discussion started by: kshitij
5 Replies
LEARN ABOUT MOJAVE
pod::simple::pullparserstarttoken
Pod::Simple::PullParserStartToken(3pm) Perl Programmers Reference Guide Pod::Simple::PullParserStartToken(3pm)
NAME
Pod::Simple::PullParserStartToken -- start-tokens from Pod::Simple::PullParser
SYNOPSIS
(See Pod::Simple::PullParser)
DESCRIPTION
When you do $parser->get_token on a Pod::Simple::PullParser object, you might get an object of this class.
This is a subclass of Pod::Simple::PullParserToken and inherits all its methods, and adds these methods:
$token->tagname
This returns the tagname for this start-token object. For example, parsing a "=head1 ..." line will give you a start-token with the
tagname of "head1", token(s) for its content, and then an end-token with the tagname of "head1".
$token->tagname(somestring)
This changes the tagname for this start-token object. You probably won't need to do this.
$token->tag(...)
A shortcut for $token->tagname(...)
$token->is_tag(somestring) or $token->is_tagname(somestring)
These are shortcuts for "$token->tag() eq somestring"
$token->attr(attrname)
This returns the value of the attrname attribute for this start-token object, or undef.
For example, parsing a L<Foo/"Bar"> link will produce a start-token with a "to" attribute with the value "Foo", a "type" attribute with
the value "pod", and a "section" attribute with the value "Bar".
$token->attr(attrname, newvalue)
This sets the attrname attribute for this start-token object to newvalue. You probably won't need to do this.
$token->attr_hash
This returns the hashref that is the attribute set for this start-token. This is useful if (for example) you want to ask what all the
attributes are -- you can just do "keys %{$token->attr_hash}"
You're unlikely to ever need to construct an object of this class for yourself, but if you want to, call
"Pod::Simple::PullParserStartToken->new( tagname, attrhash )"
SEE ALSO
Pod::Simple::PullParserToken, Pod::Simple, Pod::Simple::Subclassing
SEE ALSO
Pod::Simple::PullParserToken, Pod::Simple, Pod::Simple::Subclassing
SUPPORT
Questions or discussion about POD and Pod::Simple should be sent to the pod-people@perl.org mail list. Send an empty email to
pod-people-subscribe@perl.org to subscribe.
This module is managed in an open GitHub repository, <https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone
<git://github.com/theory/pod-simple.git> and send patches!
Patches against Pod::Simple are welcome. Please send bug reports to <bug-pod-simple@rt.cpan.org>.
COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.
AUTHOR
Pod::Simple was created by Sean M. Burke <sburke@cpan.org>. But don't bother him, he's retired.
Pod::Simple is maintained by:
o Allison Randal "allison@perl.org"
o Hans Dieter Pearcey "hdp@cpan.org"
o David E. Wheeler "dwheeler@cpan.org"
perl v5.18.2 2013-11-14 Pod::Simple::PullParserStartToken(3pm)