I'm trying to combine two files which have 1 column in common and filter out rows I don't need.
File 1:
File 2 (has 2 rows per entry):
so I do filtering of the File 1 with awk (awk '$5>0 {print}' file 1 > file1_filtered) and want to merge File 1_filtered and File 2 retaining only sequences with IDs that passes >5 filter. Ideally I want to have file with 3 columns: ID Sequence Coverage:
I am a biologist making very first steps in bash scripting so I would greatly appreciate any comments or explanations on how it should work.
I use Cygwin on Windows.
Many thanks!
Moderator's Comments:
edit by bakunin: please use CODE-tags for file content too. Thank you.
hi,
i am facing a problem in merging two files using awk,
the problem is as stated below,
file1:
A|B|C|D|E|F|G|H|I|1
M|N|O|P|Q|R|S|T|U|2
AA|BB|CC|DD|EE|FF|GG|HH|II|1
....
....
....
file2 :
1|Mn|op|qr (2 Replies)
Anyone can help for filter the uniq record for below example? Thank you very much
Input file
20090503011111|test|abc
20090503011112|tet1|abc|def
20090503011112|test1|bcd|def
20090503011131|abc|abc
20090503011131|bbc|bcd
20090503011152|bcd|abc
20090503011151|abc|abc... (8 Replies)
Hello all;
I have a large file (csv file) with addresses. I am trying to filter out specific entries based on zip code from a particular column of data. However my awk statement can not account for zipcode that begins with a certain pattern. It finds the pattern anywhere within the zipcode. ... (3 Replies)
Hi,
I need to filter and store the files ends with log extension in the array and need to write the file names in the array to a file.
I need to use array to derive this solution. Please help me out.
Thanks (2 Replies)
Hi,
I am using the following command(sed) to get the key/value pair from the string
String="{ "test":"test message", "testmessage":"subscription is active, charge successfully} " }"
status=$( echo $String | sed -e 's/^.*\("testmessage":*\).*$/\1/')
echo $status
i am getting this... (2 Replies)
Hi,
My requirement is,there is a directory location like:
:camp/current/
In this location there can be different flat files that are generated in a single day with same header and the data will be different, differentiated by timestamp, so i need to verify how many files are generated... (10 Replies)
Hi Guys,
i want copy the all files another direcotry after filtering the command.
and tried as like below...it's not working.
ls -ltr|awk '{print $9}'|grep "images\|\.htm"|cp *.* /home/oracle
Thanks (13 Replies)
Dear Gents,
Please I need your help... I need small script :) to do the following.
I have a thousand of files in a folder produced daily.
I need first to merge all files called. txt (0009.txt, 0010.txt, 0011.txt) and and to output a resume of all information on 2 separate files in csv... (14 Replies)
Discussion started by: jiam912
14 Replies
LEARN ABOUT DEBIAN
log::log4perl::filter::boolean
Filter::Boolean(3pm) User Contributed Perl Documentation Filter::Boolean(3pm)NAME
Log::Log4perl::Filter::Boolean - Special filter to combine the results of others
SYNOPSIS
log4perl.logger = WARN, AppWarn, AppError
log4perl.filter.Match1 = sub { /let this through/ }
log4perl.filter.Match2 = sub { /and that, too/ }
log4perl.filter.MyBoolean = Log::Log4perl::Filter::Boolean
log4perl.filter.MyBoolean.logic = Match1 || Match2
log4perl.appender.Screen = Log::Dispatch::Screen
log4perl.appender.Screen.Filter = MyBoolean
log4perl.appender.Screen.layout = Log::Log4perl::Layout::SimpleLayout
DESCRIPTION
Sometimes, it's useful to combine the output of various filters to arrive at a log/no log decision. While Log4j, Log4perl's mother ship,
chose to implement this feature as a filter chain, similar to Linux' IP chains, Log4perl tries a different approach.
Typically, filter results will not need to be passed along in chains but combined in a programmatic manner using boolean logic. "Log if
this filter says 'yes' and that filter says 'no'" is a fairly common requirement but hard to implement as a chain.
"Log::Log4perl::Filter::Boolean" is a special predefined custom filter for Log4perl which combines the results of other custom filters in
arbitrary ways, using boolean expressions:
log4perl.logger = WARN, AppWarn, AppError
log4perl.filter.Match1 = sub { /let this through/ }
log4perl.filter.Match2 = sub { /and that, too/ }
log4perl.filter.MyBoolean = Log::Log4perl::Filter::Boolean
log4perl.filter.MyBoolean.logic = Match1 || Match2
log4perl.appender.Screen = Log::Dispatch::Screen
log4perl.appender.Screen.Filter = MyBoolean
log4perl.appender.Screen.layout = Log::Log4perl::Layout::SimpleLayout
"Log::Log4perl::Filter::Boolean"'s boolean expressions allow for combining different appenders by name using AND (&& or &), OR (|| or |)
and NOT (!) as logical expressions. Parentheses are used for grouping. Precedence follows standard Perl. Here's a bunch of examples:
Match1 && !Match2 # Match1 and not Match2
!(Match1 || Match2) # Neither Match1 nor Match2
(Match1 && Match2) || Match3 # Both Match1 and Match2 or Match3
SEE ALSO
Log::Log4perl::Filter, Log::Log4perl::Filter::LevelMatch, Log::Log4perl::Filter::LevelRange, Log::Log4perl::Filter::StringRange
COPYRIGHT AND LICENSE
Copyright 2002-2009 by Mike Schilli <m@perlmeister.com> and Kevin Goess <cpan@goess.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2010-07-21 Filter::Boolean(3pm)