[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with Grep and date

From: Matthew Woehlke
Subject: Re: Help with Grep and date
Date: Fri, 21 Nov 2008 12:01:18 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20080723 Fedora/ Thunderbird/ Mnenhy/

omega_grey wrote:
If I have a text file full of dates in the format 01/12/08 or 1/12/08 can
grep rewrite it as 2008-12-01.

No. Why on earth would you expect grep to have that ability?

and for kicks, since I am asking. can you take 3:00 pm and make it military

You /might/ be able to do this with 'date' (somewhat complicated, but possibly most reliable). You *can* do it with sed or awk; awk is probably easier (because it can do math; with sed, you'd have to write an expression, but I don't know awk very well, so can't help much. Do your own research :-).

Please do not quote my e-mail address unobfuscated in message bodies.
Time is an illusion. Lunchtime doubly so. -- Ford Prefect (Douglas Adams' HHGttG)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]