[ale] awk question

Fletch fletch at phydeaux.org
Tue Apr 5 12:10:30 EDT 2005


>>>>> "Christopher" == Christopher Bergeron <christopher at bergeron.com> writes:

    Christopher> Guys - I have another seemingly trivial question that
    Christopher> I can't seem to figure out.  Does anyone have a
    Christopher> one-liner that can convert a line like this:

    Christopher> 'ab_ba_ab_ba','mfljwis at yahoo.com','12/15/2001'

    Christopher> into a line like this:

    Christopher> 'ab_ba_ab_ba','mfljwis at yahoo.com','1008392400'


Presuming the last field's the only thing that looks dateish:

perl -MTime::Local -pe 's{(?:(\d{1,2})/(\d{1,2})/(\d{4}))}{timelocal((0)x3,$2,$1-1,$3)}e'


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org|  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U



More information about the Ale mailing list