David C. Rankin wrote:
Listmates,
Every time I run into sed, it's a fight. I'm trying to locate a " and then strip the quote and everything that follows from each line in a file called "myfile". I am obviously horribly confused with the ranges escaped parentheses and \1 remembered patterns. Surely sed can do this, but the trees are obscuring the forest. The lines I have in myfile are all like:
/home/icons-2/filename.gif">capital seal 1</A>
The problem I am having is that the " is in the middle of a 'word' so something like cat ~/tmp/myfile | sed 's/"\([0-9A-Za-z]*\)*/\1/' doesn't work. Something as simple as cat ~/tmp/myfile | sed 's/"//' does
have you tried: sed 's/".*//' " is literal . wildcard to match any single character * match preceding pattern any number of times. Interpreted, ".* means match double-quote (") followed by any number (*) of any character(s)(.) Note...this might fail if " is the last character on the line.
find the " and delete it, but how do I get rid of the rest of the line?
Help!
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org