|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | 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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
grep numbers range
I want to grep a range of numbers in a log file. My log file looks like this:
20050807070609Z;blah blah That is a combination of yr,month,date,hours,minutes,seconds. I want to search in the log file events that happened between a particular time. like between 20050807070000 to 20050822070000 i.i all events happened between 7thAugust 7am until 22nd August 7am. I tried with grep but in vain. Help ![]() Thanks |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Use sed.
Assuming you have the start date and end date, sed -n -e '/20050807070000/,/20050822070000/p' log.file Vino |
| 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 |
| Range of numbers in HEX using AWK | greycells | Shell Programming and Scripting | 2 | 10-07-2011 10:44 AM |
| grep for a range of numbers | tamil.pamaran | Shell Programming and Scripting | 4 | 09-21-2011 05:34 PM |
| Frequency of a range of numbers | Gussifinknottle | UNIX for Dummies Questions & Answers | 1 | 01-26-2011 03:49 PM |
| read numbers from file and output which numbers belongs to which range | thepurple | Shell Programming and Scripting | 6 | 05-13-2009 06:07 AM |
| Using grep on a range of numbers | ProgChick2oo9 | UNIX for Dummies Questions & Answers | 1 | 03-15-2009 03:58 PM |
|
|