Sponsored Content
Full Discussion: Filter Data based on codes
Top Forums Shell Programming and Scripting Filter Data based on codes Post 302991526 by Don Cragun on Sunday 12th of February 2017 11:26:58 PM
Old 02-13-2017
Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum under special homework rules.

If you did not post homework, please explain the company you work for and the nature of the problem you are working on. I find the description of your problem ambiguous, so please give us a sample input file, sample codes (including how they are to be found by your script), and the exact output you are trying to extract from that input file based on the supplied codes you have provided. Please also tell us what operating system and shell you're using and show us what you have tried to solve this problem on your own.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

filter based on column value

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

extract data from a data matrix with filter criteria

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

Extract data based on match against one column data from a long list data

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

terminal codes for data partition

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

Generate Codes based on start and End values of numbers in a column

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

awk filter based on column value (variable value)

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

Filter records based on 2nd file

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

Need to filter data based on sysdate

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

Help with awk color codes based on condition

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

Filter tab file based on column value

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
Web::Scraper::Filter(3pm)				User Contributed Perl Documentation				 Web::Scraper::Filter(3pm)

NAME
Web::Scraper::Filter - Base class for Web::Scraper filters SYNOPSIS
package Web::Scraper::Filter::YAML; use base qw( Web::Scraper::Filter ); use YAML (); sub filter { my($self, $value) = @_; YAML::Load($value); } 1; use Web::Scraper; my $scraper = scraper { process ".yaml-code", data => [ 'TEXT', 'YAML' ]; }; DESCRIPTION
Web::Scraper::Filter is a base class for text filters in Web::Scraper. You can create your own text filter by subclassing this module. There are two ways to create and use your custom filter. If you name your filter Web::Scraper::Filter::Something, you just call: process $exp, $key => [ 'TEXT', 'Something' ]; If you declare your filter under your own namespace, like 'MyApp::Filter::Foo', process $exp, $key => [ 'TEXT', '+MyApp::Filter::Foo' ]; You can also inline your filter function without creating a filter class: process $exp, $key => [ 'TEXT', sub { s/foo/bar/ } ]; Note that this function munges $_ and returns the count of replacement. Filter code special cases if the return value of the callback is number and $_ value is updated. You can, of course, stack filters like: process $exp, $key => [ '@href', 'Foo', '+MyApp::Filter::Bar', &baz ]; AUTHOR
Tatsuhiko Miyagawa perl v5.14.2 2009-03-24 Web::Scraper::Filter(3pm)
All times are GMT -4. The time now is 09:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy