Hi,
Suppose if i am having a file with following records as given below.
5555
6756
5555
4555
4555
6767
how can i get the count of each record using AWK.
Eg:5555 count should be 2
4555 count should be 2
6767 count should be 1
... (5 Replies)
Hi everyone!
How can I parse a delimited field using AWK?
For example, if I have lastName#firstName or lastName*firstName. I'd like an AWK script that would return lastName and then another that would return firstName? Is this possible? (13 Replies)
input:
ref.1;rack.1;1 #group1
ref.1;rack.1;2 #group1
ref.1;rack.2;1 #group2
ref.2;rack.3;1 #group3
ref.2;rack.3;2 #group3
ref.2;rack.3;3 #group3
Among records from same group (i.e. with same 1st and 2nd field - separated by ";"), I would need to keep the last record... (5 Replies)
Hi experts,
I need to print the first field first then last two fields should come next and then i need to print rest of the fields.
Input :
a1,abc,jsd,fhf,fkk,b1,b2
a2,acb,dfg,ghj,b3,c4
a3,djf,wdjg,fkg,dff,ggk,d4,d5
Expected output:
a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
Hi All,
I am trying to insert two columns in the following text. I tried awk but failed to achieve. Highly appreciate your help
DATETIME="28-Sep-2013;20:09:08;"
CONTROL="AB"
echo "Myfile.txt;11671;7824.90;2822.48"
The DATETIME will be inserted at the beginning and CONTROL will... (4 Replies)
Hello:
I am working parsing a large input file which will be broken down into multiples based on the second field in the file, in this case: STORE.
The idea is to create each file with the corresponding store number, for example: Report_$STORENUM_$DATETIMESTAMP , and obtaining the... (7 Replies)
The below awk parser works for most data inputs, but I am having trouble with the last one. The problem is in the below rules steps 1 and 2 come from $2 (NC_000013.10:g.20763686_20763687delinsA) and steps 3 and 4 come from $1 (NM_004004.5:c.34_35delGGinsT).
Parse Rules:
The header is... (0 Replies)
I am trying to parse the input in awk to include the |gc= in $4 but am not able to. The below is close:
awk so far:
awk '{sub(/\|]+]++/, ""); print }' input.txt Input
chr1 955543 955763 AGRN-6|pr=2|gc=75 0 +
chr1 957571 957852 AGRN-7|pr=3|gc=61.2 0 +
chr1 970621 ... (7 Replies)
Hi,
My input looks like that:
A|123|qwer
A|456|tyui
A|456|wsxe
B|789|dfgh
Using awk, I am trying to get:
A|123;456|qwer;tyui;wsxe
B|789|dfgh
For records with same $1, group all the $2 in a field (without replicates), and all the $3 in a field (without replicates).
What I have tried:... (6 Replies)
Discussion started by: beca123456
6 Replies
LEARN ABOUT DEBIAN
kinosearch1::queryparser::queryparser
KinoSearch1::QueryParser::QueryParser(3pm) User Contributed Perl Documentation KinoSearch1::QueryParser::QueryParser(3pm)NAME
KinoSearch1::QueryParser::QueryParser - transform a string into a Query object
SYNOPSIS
my $query_parser = KinoSearch1::QueryParser::QueryParser->new(
analyzer => $analyzer,
fields => [ 'bodytext' ],
);
my $query = $query_parser->parse( $query_string );
my $hits = $searcher->search( query => $query );
DESCRIPTION
The QueryParser accepts search strings as input and produces Query objects, suitable for feeding into KinoSearch1::Searcher.
Syntax
The following constructs are recognized by QueryParser.
o Boolean operators 'AND', 'OR', and 'AND NOT'.
o Prepented +plus and -minus, indicating that the labeled entity should be either required or forbidden -- be it a single word, a phrase,
or a parenthetical group.
o Logical groups, delimited by parentheses.
o Phrases, delimited by double quotes.
o Field-specific terms, in the form of "fieldname:termtext". (The field specified by fieldname will be used instead of the QueryParser's
default fields).
A field can also be given to a logical group, in which case it is the same as if the field had been prepended onto every term in the
group. For example: "foo:(bar baz)" is the same as "foo:bar foo:baz".
METHODS
new
my $query_parser = KinoSearch1::QueryParser::QueryParser->new(
analyzer => $analyzer, # required
fields => [ 'bodytext' ], # required
default_boolop => 'AND', # default: 'OR'
);
Constructor. Takes hash-style parameters:
o analyzer - An object which subclasses KinoSearch1::Analysis::Analyzer. This must be identical to the Analyzer used at index-time, or
the results won't match up.
o fields - the names of the fields which will be searched against. Must be supplied as an arrayref.
o default_field - deprecated. Use "fields" instead.
o default_boolop - two possible values: 'AND' and 'OR'. The default is 'OR', which means: return documents which match any of the query
terms. If you want only documents which match all of the query terms, set this to 'AND'.
parse
my $query = $query_parser->parse( $query_string );
Turn a query string into a Query object. Depending on the contents of the query string, the returned object could be any one of several
subclasses of KinoSearch1::Search::Query.
COPYRIGHT
Copyright 2005-2010 Marvin Humphrey
LICENSE, DISCLAIMER, BUGS, etc.
See KinoSearch1 version 1.00.
perl v5.14.2 2011-11-15 KinoSearch1::QueryParser::QueryParser(3pm)