Sponsored Content
Full Discussion: File filter
Top Forums Shell Programming and Scripting File filter Post 302135123 by robotronic on Thursday 6th of September 2007 03:52:38 AM
Old 09-06-2007
Code:
nawk -v "in_msc=923210002002" '
   /^</ {
      split($0, a, "=");
      split(a[2], b, ",");
      msisdn=b[1];
   }
   /^VLR/ {
      getline;
      msc=$2;

      if (msc == in_msc) { print(msisdn); }
   }
' input_file.txt

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help filter content of a file

Hi all ! I have a file name file1 like this : /A /A/1 /A/2 /B /B/3 /B/4 /tmp/C /tmp/C/5 /tmp/C/6 I want to write a script to take content from file2 and print out to file2 only these lines : /A /B /tmp/C (12 Replies)
Discussion started by: camus
12 Replies

2. Shell Programming and Scripting

Filter record from a file

Reposting since I didnt not get any reply. I have a problem while filtering records from a file. Can somebody help please? For eg: Consider the below files Record file: 0003@00000000000190@20100401@201004012010040120100401@003@... (1 Reply)
Discussion started by: gpaulose
1 Replies

3. UNIX for Dummies Questions & Answers

Filter file according to pattern

Hello I have an input file which is tab delimited.In my unix script I have search for a particular pattern.If it is NOT present then I have to write in an output file. Eg.Input file is : 123 hello 7779 hi hkjh88 hahah 678 hello 90845 ti hkjsdfh 9324 And the search string is "123... (2 Replies)
Discussion started by: akashtcs
2 Replies

4. UNIX for Dummies Questions & Answers

Need to filter data from a file

Hi, I have a file with hundreds of records. There are four fields on each line, separated by semicolons. Name Height (meters) Country Continent (Africa,Asia,Europe,North America,Oceania,South America,The Poles) I need to Write the command to find display how many mountains appear... (1 Reply)
Discussion started by: erora
1 Replies

5. Shell Programming and Scripting

Filter a .kml file (xml) with data set from text file

I have a .kml file. So I want filter the .kml to get only the tags that have this numeric codes that they are in a text file 11951 11952 74014 11964 11965 11969 11970 11971 11972 60149 74018 74023 86378 11976 11980 11983 11984 11987 (5 Replies)
Discussion started by: pcoj33
5 Replies

6. Shell Programming and Scripting

Help with awk, using a file to filter another one

I have a main file: ... 17,466971 0,095185 17,562156 id 676 17,466971 0,096694 17,563665 id 677 17,466971 0,09816 17,565131 id 678 17,466971 0,099625 17,566596 id 679 17,466971 0,101091 17,568062 id 680 17,466971 0,016175 17,483146 id... (4 Replies)
Discussion started by: boblix
4 Replies

7. UNIX for Dummies Questions & Answers

Help me to filter a file

I want to view a file ignoring mutilple comment line (/*....*/). Please help me on this. Advance thanks.:b: (5 Replies)
Discussion started by: Pradipta Kumar
5 Replies

8. UNIX for Dummies Questions & Answers

Filter records in a huge text file from a filter text file

Hi Folks, I have a text file with lots of rows with duplicates in the first column, i want to filter out records based on filter columns in a different filter text file. bash scripting is what i need. Data.txt Name OrderID Quantity Sam 123 300 Jay 342 498 Kev 78 2500 Sam 420 50 Vic 10... (3 Replies)
Discussion started by: tech_frk
3 Replies

9. Shell Programming and Scripting

Shell script to filter records in a zip file that contains matching columns from another file

Not sure if this is the correct forum for this question. I have two files. file1.zip, file2 Input: file1.zip col1, col2 , col3 a , b , 0:0:0:0:0:c436:9346:d40b x, y, 0:0:0:0:0:880:39f9:c9a7 m, n , 0:0:0:0:0:80c7:9161:fe00 file2.txt col1 c4:36:93:46:d4:0b... (1 Reply)
Discussion started by: anil.v
1 Replies

10. Shell Programming and Scripting

Filter file with condition

Gents, I am stuck at end of my process.. I got the following file (input). And I want to filter it, checking from the column 2 to the end of the file. The condition is if in any column from cl2 to the end exist value 3, not filter, but if there is not value 3, should print all the row(output... (6 Replies)
Discussion started by: jiam912
6 Replies
MIMEDEFANG.PL(8)					      System Manager's Manual						  MIMEDEFANG.PL(8)

NAME
mimedefang.pl - Perl script to scan MIME messages. SYNOPSIS
mimedefang.pl [-f filter] dir DESCRIPTION
mimedefang.pl is a Perl script designed to work with mimedefang(8). It takes a single argument which is a directory which should contain files laid out as described in mimedefang(8). OPTIONS
-f filter Specifies the name of the file containing the filter. If this option is omitted, the default filter /etc/mimedefang-filter is used. OPERATION
mimedefang.pl evaluates the file /etc/mimedefang-filter as a Perl fragment. This file should define the filter procedure. For each part of a MIME message, mimedefang.pl calls filter and disposes of the part as instructed by the filter. The various modes of disposition are described in mimedefang-filter(5). TESTING FILTERS
You are strongly recommended to test your filter before installing it in /etc/mimedefang-filter. To test the filter, save it in a file (e.g. test-filter) and run this command: mimedefang.pl -f test-filter -test This tests the filter for syntactic correctness. If it passes, you can install it as a production filter. (Note that the test tests only for correct Perl syntax; it doesn't make sure your filter does something sensible.) MISCELLANEOUS OPTIONS
There are a few other ways to invoke mimedefang.pl: mimedefang.pl -structure < mime_message parses a message on stdin and prints lots of debugging information. mimedefang.pl -prettyprint < mime_message parses a message on stdin and prints it in a "nice" format (depending on your definition of "nice".) mimedefang.pl -features prints a list of detected optional Perl modules. The output looks something like this: SpamAssassin: yes mimedefang.pl -validate calls the function filter_validate, if it is defined in your filter. filter_validate should return an integer; this becomes the exit code. If filter_validate does not exist, an error message is printed and mimedefang.pl exits with an exit code of 1. AUTHOR
mimedefang.pl was written by David F. Skoll <dfs@roaringpenguin.com>. The mimedefang home page is http://www.mimedefang.org/. SEE ALSO
mimedefang(8), mimedefang-filter(5), mimedefang-protocol(7) 4th Berkeley Distribution 8 February 2005 MIMEDEFANG.PL(8)
All times are GMT -4. The time now is 02:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy