Sponsored Content
Top Forums Shell Programming and Scripting Grep text between multiple pattern Post 302569412 by gowtham.varma on Monday 31st of October 2011 08:26:29 AM
Old 10-31-2011
try this it worked for me...
Quote:
awk -F ")" '{print $5}' <filename> | awk -F "(" '{print $1}'
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep multiple text files in folder into 1 text file?

How do I use the grep command to take mutiple text files in a folder and make one huge text file out of them. I'm using Mac OS X and can not find a text tool that does it so I figured I'd resort to the BSD Unix CLI for a solution... there are 5,300 files that I want to write to one huge file so... (7 Replies)
Discussion started by: coppertone
7 Replies

2. Solaris

Multiple pattern on same line using grep

Hi, I would like to search multiple patterns on same line, i.e. all patterns must present on same line. Please suggest. Thanx (2 Replies)
Discussion started by: sanjay1979
2 Replies

3. Shell Programming and Scripting

Grep with multiple instances of same pattern

Hi, This is my text file I'm trying to Grep. Apple Location Greenland Rdsds dsds fdfd ddsads http Received Return Immediately Received End My Grep command: grep only--matching 'Location.*Received' e. Because the keyword Received appears twice, the Grep command will stop at the last... (0 Replies)
Discussion started by: spywarebox
0 Replies

4. Shell Programming and Scripting

Grep with multiple instances of same pattern

Hi, This is my text file I'm trying to Grep. Apple Location Greenland Rdsds dsds fdfd ddsads http Received Return Immediately Received End My Grep command: grep only--matching 'Location.*Received' Because the keyword Received appears twice, the Grep command will stop at the last... (3 Replies)
Discussion started by: spywarebox
3 Replies

5. Shell Programming and Scripting

Grep multiple line pattern and output the lines

Hi I have the following Input -- -- TABLE: BUSINESS_UNIT -- ALTER TABLE RATINGS.BUSINESS_UNIT ADD CONSTRAINT FK1_BUSINESS_UNIT FOREIGN KEY (PEOPLESOFT_CHART_FIELD_VALUE_ID) REFERENCES RATINGS.PEOPLESOFT_CHART_FIELD_VALUE(PEOPLESOFT_CHART_FIELD_VALUE_ID) ; ALTER TABLE... (1 Reply)
Discussion started by: pukars4u
1 Replies

6. Shell Programming and Scripting

How to grep multiple pattern from XML file

Hi Everyone pls if anyone can help me in writing a script or correcting it what I have done. I want to write a script to grep record number for all those record which have abc xyd cat dog in one of the field say VALUE, I have thousand of file in a dir and I want to search every file for... (6 Replies)
Discussion started by: revertback
6 Replies

7. Shell Programming and Scripting

Grep command with multiple pattern

Hi, I want to search multiple patterns in a variable. DB_ERR=`echo "$DB_TRANS" | grep "SP2-" | grep "ORA-"` echo $DB_ERR But I am not getting anything in DB_ERR. I want to print each line on seperate line. Could you please help me out in this. Thanks in advance. (14 Replies)
Discussion started by: Poonamol
14 Replies

8. Linux

Creating 2 variables from a multiple pattern grep

first time poster here Im pretty new to grep and linux in general and I spent pretty much all day yesterday researching and coming up with a grep command to help with my university project. I am attempting to create a proof of concept bash script to scan the network using ngrep, find appropriate... (7 Replies)
Discussion started by: scottish_jason
7 Replies

9. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies

10. Shell Programming and Scripting

Grep multiple pattern

I have got a text from each line, I need to fetch port only if there is an ip a.text text and port=25 b.ip=(12.32.54.256) and port="52" c.ip=(55.251.253.12) and port=25" d.text text and port="5" e.ip=(45.211.155.15) and port="457" f.ip=(144.158.256.2) and port="588" I know how to... (6 Replies)
Discussion started by: arpagon
6 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 03:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy