On Tue, 15 Feb 2000, Michael O'Donnell wrote:
>
> Oooops - that last / character shouldn't be there. And I
> now realize I'm not sure what you wanted to do; that sed
> command will rewrite instances of xx/yy/zz to be zz/yy/xx,
> so mm/dd/yy would become yy/dd/mm. If you instead wanted
> mm/dd/yy to become yy/mm/dd the command would be:
>
> sed -e 's;\(..\)/\(..\)/\(..\);\3/\1/\2;' <originalFile >newFile
>
>
> Sorry about that - I shot from the hip and only hit my toe...
I am happy to have whatever help I can get. Thanks.
This kind of works. I didn't explain well.
The file I have is set up as such:
id,mm/dd/yy/,text,$00.00
When I run the above sed command, it fixes the date, but not all of the id
numbers are still separated by commas. For example:
1,98/3/16,misc,$100.00
299/,7/4,misc,$100.00
etc., seemingly at random
As you can see, in record 2 the comma has been moved to the right of the
first /.
I know nothing about sed, and it is not apparent to me how to correct
this.
I'll come back to it later tonight.
Thanks to all.
--
Charles Farinella
[EMAIL PROTECTED]
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************