On Thu, 13 Dec 2012, Scott Bigelow wrote:

> I think sed is up to the task, here's one way to do it without busting out
> a scripting language:
>
> sed -e
> 's#\([[:digit:]]\{2\}\)/\([[:digit:]]\{2\}\)/\([[:digit:]]\{4\}\)#\3-\1-\2#'
>
> It looks like a mouthful, but it's really quite simple; it just matches
> AA/BB/CCCC and makes it CCCC-AA-BB. If you get false matches within other
> columns, you could try anchoring against the comma that bounds the field.

   Thanks, Scott. As I walked the dog just now (the other one's tight asleep
on the bed) it occurred to me that sed should be able to do the job. I'm
still a novice with sed and awk so I greatly appreciate the lesson!

Rich

_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to