![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk and regular expression | maskot | Shell Programming and Scripting | 4 | 05-22-2007 08:22 AM |
| Regular Expression problem | djkane | Shell Programming and Scripting | 5 | 06-21-2006 11:07 AM |
| Regular Expression Problem | netmaster | UNIX for Dummies Questions & Answers | 1 | 12-07-2005 09:34 PM |
| Complex Pipeline/Redirection/Regular Expression problem | netmaster | UNIX for Dummies Questions & Answers | 1 | 11-29-2005 12:55 AM |
| Regular Expression + Aritmetical Expression | Z0mby | Shell Programming and Scripting | 2 | 05-21-2002 11:59 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Regular Expression Problem
this is how my xyz.log file loooks like :-
[30/Dec/2008:12:03:07] info ( 816): CORE1116: Sun ONE Web Server 6.1SP5 B08/17/2005 22:09 [31/Dec/2008:12:03:08] info ( 817): CORE5076: Using [Java HotSpot(TM) Server VM, Version 1.5.0_11] from [Sun Microsystems Inc .] [01/Jan/2008:12:03:08] info ( 817): WEB0100: Loading web module in virtual server [http-google] at [/abc] [02/Jan/2008:12:03:08] info ( 817): WEB0100: Loading web module in virtual server [http-google] at [/abc] Code:
perl -MPOSIX -i.bak -ne 'BEGIN{
$d=strftime("%d%m%Y",localtime time-60*24*60*60);
@m{qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)}=("01".."12")}
print if m"^(\d+)/(\w+)/(\d{4})"&& "$1$m{$2}$3" gt $d' xyz.log
Any info will be really appreciated. I am new to regular expression. |
| Bookmarks |
| Tags |
| perl, perl regex, regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|