First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Hi all!
I have a data set in this tab separated format : Label, Value1, Value2
An instance is "data.txt" :
0 1 1
-1 2 3
0 2 2
I would like to parse this data set and generate two files, one that has only data with the label 0 and the other with label -1, so my outputs should be, for... (1 Reply)
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)
i run command that return this result,example :
gigabitethernet2/2/4:NotPresent, gigabitethernet2/1/17:UP, gigabitethernet2/1/10:UP, gigabitethernet2/1/5:UP,
gigabitethernet2/1/9:UP, gigabitethernet2/1/36:DOWN, gigabitethernet2/1/33:DOWN, gigabitethernet2/1/8:UP,... (19 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)
I am trying to look for $2 of file1 (skipping the header) in $2 of file2 (skipping the header) and if they match and the value in $10 is > 30 and $11 is > 49, then print the line from file1 to a output file. If no match is foung the line is not printed. Both the input and output are tab-delimited.... (3 Replies)
Hi Team,
Could you please help me with the below scenario.
I have a file which is in the below format.
Zipcode,001,001f,002,002f,003,003f,004,004f,005,005f,006,006f,007,007f
0050, ,0, ,0, ,0, ,1,*,7, ,7, ,7
0060, ,0, ,0, ,7, ,0,*,7, ,0, ,0
Would need the output as below.
First field... (1 Reply)
Hi,
So awk is driving me crazy on this one. I have searched everywhere and read man, docs and every related post Google can find and still no luck. The actual files I need to run this on are sensitive in nature, but it is the same thing as if I needed to calculate weighted grades for multiple... (15 Replies)
Discussion started by: cotilloe
15 Replies
LEARN ABOUT DEBIAN
jifty::dbi::filter
Jifty::DBI::Filter(3pm) User Contributed Perl Documentation Jifty::DBI::Filter(3pm)NAME
Jifty::DBI::Filter - base class for Jifty::DBI filters
SYNOPSIS
# To implement your own filter
package MyApp::Filter::Uppercase;
use base qw/ Jifty::DBI::Filter /;
# Setup for DB storage, store in lowercase
sub encode {
my $self = shift;
my $value_ref = $self->value_ref;
return unless defined $$value_ref; # don't blow up on undef
$$value_ref = lc $$value_ref;
}
# Setup for Perl code to use, always sees uppercase
sub decode {
my $self = shift;
my $value_ref = $self->value_ref;
return unless defined $$value_ref; # don't blow up on undef
$$value_ref = uc $$value_ref;
}
# To use a filter
use MyApp::Record schema {
column filtered =>
type is 'text',
filters are qw/ MyApp::Filter::Uppercase /;
};
DESCRIPTION
A filter allows Jifty::DBI models to tweak data prior to being stored and/or loaded. This is useful for marshalling and unmarshalling
complex objects.
METHODS
new
Takes three arguments in a parameter hash:
value_ref
A reference to the current value you're going to be massaging. "encode" works in place, massaging whatever value_ref refers to.
column
A Jifty::DBI::Column object, whatever sort of column we're working with here.
handle
A Jifty::DBI::Handle object, because some filters (i.e. Jifty::DBI::Filter::Boolean) depend on what database system is being used.
encode
"encode" takes data that users are handing to us and marshals it into a form suitable for sticking it in the database. This could be
anything from flattening a DateTime object into an ISO date to making sure that data is utf8 clean.
decode
"decode" takes data that the database is handing back to us and gets it into a form that's OK to hand back to the user. This could be
anything from inflating an ISO date to a DateTime object to making sure that the string properly has the utf8 flag.
SEE ALSO
Jifty::DBI::Filter::Date, Jifty::DBI::Filter::DateTime, Jifty::DBI::Filter:SaltHash, Jifty::DBI::Filter::Storable,
Jifty::DBI::Filter::Time, Jifty::DBI::Filter::Truncate, Jifty::DBI::Filter::YAML, Jifty::DBI::Filter::base64, Jifty::DBI::Filter::utf8
LICENSE
Jifty::DBI is Copyright 2005-2007 Best Practical Solutions, LLC. Jifty::DBI is distributed under the same terms as Perl itself.
perl v5.14.2 2010-12-09 Jifty::DBI::Filter(3pm)