On Thu, 13 Dec 2012 14:28:35 -0800 (PST)
Rich Shepard <[email protected]> wrote:

>    I've a data file with rows that begin like this:
> 
> '1995SBOIC020',1,'08/04/2004','Failed',
> 
> and I want to change the date to ISO format, '2004-08-04'. I tried
> with emacs regex to change the slash to a hyphen but without success.
> And I don't think regex will allow me to re-order the date numbers.
> 
>    Can SED be applied to this or is there a more elegant way to
> filter the file so that all date fields are modified? I've tried a
> few things but haven't seen the light of inspiriation that indicates
> I've done it correctly.
> 
> Thoughts?

To use emacs to turn the slashes into hyphens do 

    M-x replace-regexp \/ RET - RET

That will take care of the slashes.  Once you've got the hyphens taken
care of, you can use the regexp searches and the register commands to
swap the numbers around.

Hope this helps.

--Dale

--
"Shambling, drooling, bent on destruction and biting people's
heads off... it's either zombies or upper management." -- Ebenezer
Dusk, Esquire
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to