Advertisement

sed - simple question *SOLVED*

Started by August 29, 2006 09:33 AM
1 comment, last by yitzle 18 years, 3 months ago
OK. Simple question. I need some help with runnning a RegEx. Using the Windows Notepad++, I managed to replace ( [A-Z]* ) ( [A-Z][a-z]* ) with \1,\2 So my CSV phone directory which had a coule LASTFirst was fixed to LAST,First But I couldn't manage to pull it off with the sed. And I don't think tr is what I wanted... I tried sed s/ ( [A-Z]* ) ( [A-Z][a-z]* ) / \1,\2 / and I tried putting a '\' in front of: the ',', the '()'s, the '[]'s. Can someone kindly show me how it is supposed to be done? Thanks! EDIT: > sed s / \( [A-Z]* \) \( [A-Z] [a-z]* \) / \1,\2 / > sed: -e expression #1, char 1: unterminated `s' command
Off the top of my head:

nicollet@clipper /users/04/info/nicollet> sed -e 's/\([A-Z]*\) \([A-Z][a-z]*\)/\1,\2/'NICOLLET VictorNICOLLET,Victor
Advertisement
Arg!
Thanks!
I think I needed the ' before and after and was missing it ;)
It works without the -e, but not without the single quotes.
Thank you!

This topic is closed to new replies.

Advertisement