|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Cut particular lines
All, I would like to cut all the lines from the log file for the timestamp . I'm not clear about how to apply grep ,awk here.Can you help me on this ? My logfile: ********** Code:
Wed Feb 20 03:48:26 2013 Thread 1 advanced to log sequence 400 (LGWR switch) Thu Feb 21 02:34:23 2013 Starting background process CJQ0 Thu Feb 21 02:34:23 2013 CJQ0 started with pid=14, OS id=29548 Thu Feb 21 03:00:00 2013 Fri Feb 22 03:00:04 2013 Begin automatic SQL Tuning Advisor run for special tuning task "SYS_AUTO_SQL_TUNING_TASK" My output should be: - I need Feb21 content here. ******************* Code:
Thu Feb 21 02:34:23 2013 Starting background process CJQ0 Thu Feb 21 02:34:23 2013 CJQ0 started with pid=14, OS id=29548 Thu Feb 21 03:00:00 2013 Thanks Arul
Last edited by bakunin; 02-22-2013 at 02:17 PM.. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Please use code tags as required by forum rules. Your request is not that easy to fulfill as the file structure (time stamp \n line) is not consistenely followed, so further evaluations need to be applied. For a start, try Code:
awk 'match($0, dt) {print; getline; print}' dt="Feb 21" file |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cut Lines using grep | bhupinder08 | Shell Programming and Scripting | 3 | 08-11-2012 04:34 PM |
| cut particular lines from a file | kvok | UNIX for Dummies Questions & Answers | 2 | 05-12-2010 07:58 AM |
| cut lines in a file. | jimmy_y | Shell Programming and Scripting | 5 | 07-28-2009 03:30 AM |
| Cut lines before keyword | Trump | Shell Programming and Scripting | 4 | 03-18-2009 11:08 PM |
| cut 11 lines from a file | turk22 | Shell Programming and Scripting | 7 | 05-12-2006 03:02 PM |
|
|