![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| grep string & a few lines after | ashterix | Shell Programming and Scripting | 7 | 12-07-2008 09:20 AM |
| Grep string but also it will show the next 5 lines | thepurple | Shell Programming and Scripting | 10 | 10-07-2008 08:03 AM |
| Grep for lines between words in a file using TCL.. | ramkriz | Shell Programming and Scripting | 3 | 08-26-2008 08:55 AM |
| find string, then get the next 3 lines in a file | lyoncc | Shell Programming and Scripting | 8 | 11-07-2007 06:30 AM |
| grep string & next n lines | ashterix | Shell Programming and Scripting | 8 | 11-21-2005 11:38 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
To grep 10 lines after a string in a txt file.
Hi All,
I am trying to pull 10 lines from a file after some particular string. Please help me in doing so. Example; Let us take a file. Test_file_log.txt Test_file_log contents: request_id = 11191 Test data related to 11122 test date trst data test data request_id = 11123 test data related to 11123 test_data test_data request_id = 11234 test data related to 11234 test_data test_data Our requirment: Need to get the data for the given request_id and send it over to other file. here request_id is dynamic. We pass the request_id value. Let us suppose we need the data for v_request_id = 11123 grep "request_id = v_request_id" and also 10 lines after this string. Then send this information to other file. >request_id_data.txt Finally Request_id_data.txt should have the log of only the given request_id Please help me in coding the above. I am searching in all forums but cannot able to get the info. We are trying to do this from past 2 months. Thanks in advance Regards, Suman. |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|