parse date/time from a log entry with only strftime (and no regexen)

Simon Mullis simon at mullis.co.uk
Thu Feb 5 05:50:05 EST 2009


That, my friend, is ingenious...!

Thankyou

SM

2009/2/3 andrew cooke <andrew at acooke.org>

> > > ValueError: unconverted data remains:  this is the remainder of the log
>
> > > line
> > > that I do not care about
>
> you could catch the ValueError and split at the ':' in the .args
> attribute to find the extra data.  you could then find the extra data
> in the original string, use the index to remove it, and re-parse the
> time.
>
> ugly, but should work.
> andrew
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Simon Mullis
_________________
simon at mullis.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090205/47366b0c/attachment-0001.html>


More information about the Python-list mailing list