AWK: Grep Pattern and print help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting AWK: Grep Pattern and print help
# 15  
Old 02-28-2012
Alternatively, not very robust, but just for fun:
Code:
awk '{print $4,$8,$13,$37,$32,$59,$64,$83,$87}' RS= infile

# 16  
Old 02-28-2012
Corona688,
Awesome! Quite a complex scripting.
Once again thank you for your patience and help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Recursively grep for a pattern and print that whole word

Hello Forum Members, I am trying to write a script for a requirement where i have to recursively search for a pattern and replace it with the new string in run time from user inputs grep -ohr "]*.xyz.com]*" $HOME/source/group/ | sort | uniq > $HOME/output.txt while read -r -u9 line; ... (4 Replies)
Discussion started by: raokl
4 Replies

2. AIX

Grep a pattern and print following n lines

Hi all, I am struck with the below requirement. I need to grep a particular pattern in a file and then print next n lines of it for further processing. I have used the below code grep -A 3 "pattern" filename But it is throwing error as below. grep: illegal option -- A Can... (14 Replies)
Discussion started by: ssk250
14 Replies

3. 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

4. Shell Programming and Scripting

How to print the lines between the pattern using awk/grep/sed?

Hi, I need a help to search a pattern and print the multiple lines between them. Input file: Tue May 29 12:30:33 EDT 2012:threadWebContainer : 357:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelCancelReservation request: ... (4 Replies)
Discussion started by: aroragaurav.84
4 Replies

5. Shell Programming and Scripting

grep based on pattern in a line and print the column before that

$ cat file.log Message Number = : Sending message 10:50:16^|^reqhdr.dummyid^=^02^|^reqhdr.timezone^=^GMT+05:30^|^DUMMYREQUEST^=^BH||||||||||||||||||$BD|OL|C|V||DummyAcctNo|02||24/12/2011|ST_DDM|DDM||||||||reqUUID110612105016$BT||||||||||||||||||$] Length I have the above line in the... (4 Replies)
Discussion started by: kalidass
4 Replies

6. Shell Programming and Scripting

Print the above and below lines for the grep pattern.

Hi, i would like to get the above and below lines of the grep pattern . For ex : file as below: chk1- aaaa 1-Nov chk2 -aaaa ########## chk1-bbbbbb 1-Nov chk2-bbbbbb ######### my search pattern is date : 1-Nov i need the o/p as below chk1- aaaa 1-Nov (6 Replies)
Discussion started by: expert
6 Replies

7. Solaris

Using grep to print just the pattern match

Hi all, Is it possible for grep to output just the pattern match and not the whole line when it comes across a match? I know you can adjust the number of trailing or leading lines that are printed, but am yet to find anything that outputs just the pattern match. Cheers, Tim (5 Replies)
Discussion started by: muzzaw
5 Replies

8. UNIX for Dummies Questions & Answers

Lynx Grep Pattern Match 2 conditions Print from Start to End

I am working on a scraping project and I am stuck at this tiny grep pattern match. Sample text : FPA List. FPA List. FPA List. FPA List. FPA List. FPA List. FPA List. FPA List. ABC Personal Planning Catherine K. Wat Cath Wat Catherine K. Wat Catherine K. Wat IFRAME:... (8 Replies)
Discussion started by: kkiran
8 Replies

9. Shell Programming and Scripting

Use to awk to match pattern, and print the pattern

Hi, I know how to use awk to search some expressions like five consecutive numbers, , this is easy. However, how do I make awk print the pattern that is been matched? For example: input: usa,canada99292,japan222,france59664,egypt223 output:99292,59664 (6 Replies)
Discussion started by: grossgermany
6 Replies

10. Shell Programming and Scripting

Grep for a pattern and print entire record

Hi friends, This is my very first post on forum, so kindly excuse if my doubts are found too silly. I am trying to automate a piece of routine work and this is where I am stuck at the moment-I need to grep a particular ID through a file containing many records(which start with <LRECORD> and end... (6 Replies)
Discussion started by: faiz1985
6 Replies
Login or Register to Ask a Question