If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > sed operation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-04-05, 14:30
mvillan mvillan is offline
Registered User
 
Join Date: Dec 2003
Location: Ogden Utah
Posts: 34
sed operation

I have a file where I have to remove the commas that are between quotation marks and then replace the quatation marks with a pipe |. ie

so far I have sed 's/\("*[,]*"\)/\|/g' and this replaces the quotation marks with a | and it removes the (,) comma......but I feel I am going about it the wrong way so it would be good to get some different suggestions.

file
"Hello, World"
"Hello World,"
"Hel, lo World"

result

|Hello World|
|Hello World|
|Hello World|

Regards,
Milenko
__________________
mvilla
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On