Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
We don't bite newbies here... much
 
PerlMonks  

Re: Deleting lines prior to a date!

by SamCG (Hermit)
on May 09, 2006 at 10:18 UTC ( [id://548215]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Deleting lines prior to a date!

Look at Date::Calc for date arithmetic. You could print out only the lines you want to a separate file, then delete or back up the original.


-----------------
s''limp';@p=split '!','n!h!p!';s,m,s,;$s=y;$c=slice @p1;so brutally;d;$n=reverse;$c=$s**$#p;print(''.$c^chop($n))while($c/=$#p)>=1;

Replies are listed 'Best First'.
Re^2: Deleting lines prior to a date!
by Anonymous Monk on May 09, 2006 at 10:50 UTC
    How would I print the whole line:
    open(FILE, $path) or die "Can't open $path: $!"; while (<FILE>) { $lines++; if($_=~/(.*)(2006-5-9)(.*?)/gs){print "Line $lines - found = $ +1$2^^^^^ $3^^^^^<br>";} } close FILE;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://548215]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.