Sponsored Content
Top Forums Shell Programming and Scripting [Help] PERL Script - grep multiple lines Post 302267467 by miskin on Friday 12th of December 2008 11:31:03 AM
Old 12-12-2008
[Help] PERL Script - grep multiple lines

Hi Gurus,

I need some help with the "grep" command or whatever command that you think suitable for me. I'm about to write a perl script to extract a report from the system and submit it to the end users. The input for the script will consist of 3 element.

1) Generation ID
2) Month
3) Year

I have a text file that contain the following data :


*Its actually quite a long data (from 2001 to 2008) but the format are the same Smilie*

I need to get those 3 element for the input in my perl script. The main element is Generation <ID#>. Let say from the sample data above, i want the data with the date of Jan 2001 to let say Dec 2001, in order to get the Generation ID#, i need to search for all the JAN to DEC 2001's Generation ID#.

So the question is, how can i do that ? Smilie

Thanks,

Last edited by miskin; 06-16-2009 at 10:23 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep on multiple lines

I 'm trying to grep 2 fieldds on 2 differnt lines. Like this: psit > file egrep -e '(NS|ES)' $file. Not working. If this succeeds then run next cmd else exit. Pls Help Gundu (13 Replies)
Discussion started by: gundu
13 Replies

2. Shell Programming and Scripting

grep multiple lines

Hey guys: I've been meaning to post this question for awhile...it is regarding grep. Let's say for example that the following entry is in logxx: Wed Feb 2 07:44:11 <vsm> 91030 Line 5 Severity 1 Vps 6 Call Answered - DN:8753101 CLID:5164665761 PI:83 If I do a grep 91030... (27 Replies)
Discussion started by: cdunavent
27 Replies

3. Shell Programming and Scripting

grep multiple lines

Hi. I have this format on a textfile: VG Name /dev/vg00 PV Name /dev/dsk/c16t0d0 PV Name /dev/dsk/c18t0d0 PV Name /dev/dsk/c16t4d0 VG Name /dev/vg01 PV Name ... (6 Replies)
Discussion started by: jOOc
6 Replies

4. Shell Programming and Scripting

shell script: grep multiple lines after pattern match

I have sql file containing lot of queries on different database table. I have to filter specific table queries. Let say i need all queries of test1,test2,test3 along with four lines above it and sql queries can be multi lines or in single line. Input file contains. set INSERT_ID=1; set... (1 Reply)
Discussion started by: mirfan
1 Replies

5. Shell Programming and Scripting

Perl XML, find matching condition and grep lines and put the lines somewhere else

Hi, my xml files looks something like this <Instance Name="New York"> <Description></Description> <Instance Name="A"> <Description></Description> <PropertyValue Key="false" Name="Building A" /> </Instance> <Instance Name="B"> ... (4 Replies)
Discussion started by: tententen
4 Replies

6. UNIX for Dummies Questions & Answers

grep command to find multiple strings in multiple lines in a file.

I want to search files (basically .cc files) in /xx folder and subfolders. Those files (*.cc files) must contain #include "header.h" AND x() function. I am writing it another way to make it clear, I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies

7. UNIX for Dummies Questions & Answers

grep in multiple lines

hi i have kind of below text in a file. I want to get a complete paragraph starting with START and ending with before another START) which has a particular string say XYZ or ABC START XYZ hshjghkjh 45 ljkfd fldjlj d jldf START 3493u ABC 454 4545454 4545454 45454 4545454 START ...... (3 Replies)
Discussion started by: reldb
3 Replies

8. UNIX for Advanced & Expert Users

grep across multiple lines

How do you grep 'select * from table_name' string from a script if the select * and from table_name are on 2 different lines ? like select * from table_name Any help would be greatly appreciated !!! Thanks RDR (4 Replies)
Discussion started by: RDR
4 Replies

9. UNIX for Dummies Questions & Answers

Grep multiple lines

I want to grep multiple lines from a text file. I want to grep all lines containing X,Y and NA in a single command. How do I go about doing that? This is what my text files look like: rs1983866 0.0983 10 100016313 rs1983865 0.5994 X 100016339 rs1983864 0.3272 11 100017453 rs7077266... (2 Replies)
Discussion started by: evelibertine
2 Replies

10. Shell Programming and Scripting

Perl script: matching multiple lines error

Dear Perl users, Could somebody help me how to fix my code so I can get my desired output. Here is the data: Pattern Gabriel halo1 halo2 end Pattern Andreas halo1 halo2 endI want to grep multiple lines between the pattern /Pattern Gabriel / and /end/. Then I will store the output into... (6 Replies)
Discussion started by: askari
6 Replies
AuMakeElementExportMonitor(3)				     Library Functions Manual				     AuMakeElementExportMonitor(3)

Name
       AuMakeElementExportMonitor - initialize an ExportMonitor element

Synopsis
       #include <audio/audiolib.h>

       AuMakeElementExportMonitor(element, input, event_rate, format, num_tracks)
	   AuElement *element; /* RETURN */
	   unsigned short input;
	   unsigned short event_rate;
	   unsigned char format;
	   unsigned char num_tracks;

Arguments
       element	 Returns the initialized element.

       input	 Specifies the index of the element to supply the audio data to monitor.

       event_rate
		 Specifies the event rate for the monitor.

       format	 Specifies  the  format  of the audio data.  Currently, the following formats are defined: AuFormatULAW8, AuFormatLinearUnsigned8,
		 AuFormatLinearSigned8, AuFormatLinearSigned16MSB, AuFormatLinearUnsigned16MSB, AuFormatSignedLinear16LSB,  and  AuFormatLinearUn-
		 signed16LSB.

       num_tracks
		 Specifies the number of tracks in the audio data.

Description
       AuMakeElementExportMonitor  sets  the type member of element to AuElementTypeExportMonitor and initializes the exportmonitor member of ele-
       ment with the remaining arguments.

       AuMakeElementExportMonitor is implemented as a macro.

See Also
       AuMakeElementAddConstant, AuMakeElementBundle, AuMakeElementExportBucket, AuMakeElementExportClient, AuMakeElementExportDevice,	AuMakeEle-
       mentImportBucket,  AuMakeElementImportClient,  AuMakeElementImportDevice, AuMakeElementImportWaveForm, AuMakeElementMultiplyConstant, AuMa-
       keElementSum.

       audiolib - Network Audio System C Language Interface

audiolib - element initialization				       1.9.3					     AuMakeElementExportMonitor(3)
All times are GMT -4. The time now is 05:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy