02-12-2017
Filter Data based on codes
Hello,
I have a question on how to filter the data on multiple columns. The problem is I have one table with 25 columns, 4500 rows. I need to filter out the data based on some codes like 'XXXX', I have 25 codes to check on that table. My requirement is that which ever row has this code I need to create a new column and print that code (like if a row contains that code need to print that code in new column). The problem is that we don't know in which column these codes are there, so we need to check each record to filter out the data. Please help me out if you have any solution for this.
Thank you for taking time and helping me out.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file with colon separated values.. the sample is attached below.
No of fields in each record/line is dependent on the value of field53.
What I need to do is to design a special filter based on specific requirement of some match of values in particular column or combination of columns.
... (2 Replies)
Discussion started by: rraajjiibb
2 Replies
2. Shell Programming and Scripting
Here is what old matrix look like,
IDs X1 X2 Y1 Y2
10914061 -0.364613333 -0.362922333 0.001691 -0.450094667
10855062 0.845956333 0.860396667 0.014440333 1.483899333... (7 Replies)
Discussion started by: ssshen
7 Replies
3. Shell Programming and Scripting
My input file:
data_5 Ali 422 2.00E-45 102/253 140/253 24
data_3 Abu 202 60.00E-45 12/23 140/23 28
data_1 Ahmad 256 7.00E-45 120/235 140/235 22
data_4 Aman 365 8.00E-45 15/65 140/65 20
data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies
4. UNIX Desktop Questions & Answers
Among other critical Linux challenges terminal code looms large.
Got this far and think I am right. See attachment and when I open I get
Error opening file '/home/allen/data1/ Permission denied
could someone give me the chown code or anything else I lack
allen@allen-laptop:~$ sudo mkdir... (2 Replies)
Discussion started by: 77yrold
2 Replies
5. Shell Programming and Scripting
Hello All,
Could you please help with this.
This is what I have:
506234.222 2
506234.222 2
506234.222 2
506234.222 2
508212.200 2
508212.200 2
333456.111 2
333456.111 2
333456.111 2
333456.111 2
But this is what I want:
506234.222 1
506234.222 2
506234.222 2
506234.222 3 (5 Replies)
Discussion started by: canimba
5 Replies
6. Shell Programming and Scripting
Hi,
I have a requirement to display/write the 3rd column from a file based on the value in the column 3.
Ex: Data in the File (comma delimited)
ID,Value,Description
1,A,Active
1,I,Inactive
2,S,Started
1,N,None
2,C,Completed
2,F,Failed
I need to first get a list of all Unique IDs in... (7 Replies)
Discussion started by: kiranredz
7 Replies
7. Shell Programming and Scripting
Hello,
I want to filter records of a file if they fall in range associated with a second file. First the chr number (2nd col of 1st file and 1st col of 2nd file) needs to be matched. Then if the 3rd col of the first file falls within any of the ranges specified by the 2nd and 3rd cols , then... (4 Replies)
Discussion started by: ritakadm
4 Replies
8. Shell Programming and Scripting
I have a file from which I need to filter out certain lines when field 17 is less than sysdate. The file has date in YYYYMMDD HH:MI:SS format.
Sample file is as below:
PRUM,67016800 ,CC ,C1,67016800 ,00,Y,Y,2 ,US,BX,BOX ... (5 Replies)
Discussion started by: mady135
5 Replies
9. Shell Programming and Scripting
HI
i have two files say test and test1
Test.txt
Code:
Lun01 2TB 1.99TB 99.6%
Lun02 2TB 1.99TB 99.5%
Lun03 2TB 1.99TB 99.5%
Lun04 2TB 1.55TB 89.6%
Code:
Test1.txt
Lun01 2TB 1.99TB 89.5%
Lun02 2TB 1.99TB 99.5%
Lun03 2TB 1.99TB 99.5%
Requirement is to compare... (6 Replies)
Discussion started by: venkitesh
6 Replies
10. Shell Programming and Scripting
Hello
I have a tab text file with many columns and have to filter rows ONLY if column 22 has the value of '0', '1', '2' or '3' (out of 0-5).
If Column 22 has value '0','1', '2' or '3' (highlighted below), then remove anything less than 10 and greater 100 (based on column 5) AND remove anything... (1 Reply)
Discussion started by: nans
1 Replies
LEARN ABOUT OSX
mail::filter
Mail::Filter(3) User Contributed Perl Documentation Mail::Filter(3)
NAME
Mail::Filter - Filter mail through multiple subroutines
SYNOPSIS
use Mail::Filter;
my $filter = Mail::Filter->new( &filter1, &filter2 );
my $mail = Mail::Internet->new( [<>] );
my $mail = $filter->filter($mail);
my $folder = Mail::Folder->new( .... );
my $filter->filter($folder);
DESCRIPTION
"Mail::Filter" provides an interface to filtering Email through multiple subroutines.
"Mail::Filter" filters mail by calling each filter subroutine in turn. Each filter subroutine is called with two arguments, the first is
the filter object and the second is the mail or folder object being filtered.
The result from each filter sub is passed to the next filter as the mail object. If a filter subroutine returns undef, then "Mail::Filter"
will abort and return immediately.
The function returns the result from the last subroutine to operate on the mail object.
METHODS
Constructors
Mail::Filter->new([FILTER [, ... ]])
Create a new "Mail::Filter" object with the given filter subroutines. Each filter may be either a code reference or the name of a
method to call on the <Mail::Filter> object.
Accessors
$obj->add(FILTER [, FILTER ...])
Add the given filters to the end of the fliter list.
Processing
$obj->filter(MAIL-OBJECT | MAIL-FOLDER)
If the first argument is a "Mail::Internet" object, then this object will be passed through the filter list. If the first argument is a
"Mail::Folder" object, then each message in turn will be passed through the filter list.
$obj->folder()
While the "filter" method is called with a "Mail::Folder" object, these filter subroutines can call this method to obtain the folder
object that is being processed.
$obj->msgnum()
If the "filter" method is called with a "Mail::Folder" object, then the filter subroutines may call this method to obtain the message
number of the message that is being processed.
SEE ALSO
This module is part of the MailTools distribution, http://perl.overmeer.net/mailtools/.
AUTHORS
The MailTools bundle was developed by Graham Barr. Later, Mark Overmeer took over maintenance without commitment to further development.
Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce
<Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog.
LICENSE
Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2007 Mark Overmeer <perl@overmeer.net>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See
http://www.perl.com/perl/misc/Artistic.html
perl v5.16.2 2012-08-29 Mail::Filter(3)