Thanks for the fast reponse, but this doesn't seem to do anything. I'm assuming the i after the g is a typo. I get a sed: Command garbled if I leave it in there.
Main Topics
Browse All TopicsHello,
I'm trying write a simple script with sed, but can't seem to get it right. My problem is, I get comma delimted files with different records in it, and in one of the records is a field that contains a very long string which I essentially need to cut out, more aptly, trim it down to a managble size.
The sed command I have been working with is:
sed -e 's/The standard panel includes.*"/The standard Panel/g' input.csv > output.csv
However, this command wipes out the rest of the line/fields of that record. It needs to replace up to the ending quote (") then stop. Thanks in advance.
P.S. The record has the format:
99999, p, "Text, Sample", 555555555, "The standard panel includes ... ", text, more text, 2222222, text comment
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Is this not the output you'd expect?
$ echo '99999, p, "Text, Sample", 555555555, "The standard panel includes ... ", text, more text, 2222222, text comment' | sed -e 's/The standard panel includes[^"]\+"/The standard Panel"/gi'
99999, p, "Text, Sample", 555555555, "The standard Panel", text, more text, 2222222, text comment
$
Well, as usuall, I made a stupid mistake.
$ sed --version
sed --version
sed: ERROR: Illegal option -- -
usage: sed [-ng] script [file ...]
sed [-ng] [-e script] ... [-f script-file] ... [file ...]
Which made me dig deeper for the version, which made me realize I was ssh'd to a Sco Unix machine, not Linux. Sorry for the confusion. Can you still help me or do I need to take this over to the Unix programming page?
Business Accounts
Answer for Membership
by: Tim_UtschigPosted on 2006-02-09 at 08:24:52ID: 15914033
sed -e 's/The standard panel includes[^"]\+"/The standard Panel"/gi' input.csv > output.csv