Solved

How can I replace this string in sed?

Posted on 2013-05-23
2
328 Views
Last Modified: 2013-05-24
Hi,

I have a large csv file with lines with strings like below
How can I convert this in sed for all lines?
The values can be anything, it's just that the list is in [u'xxx']

"[u'Kitts Corner', u'Jovita']", abc, "[u'AAA', u'BBB', u'CCC']"
to
"Kitts Corner,Jovita", abc, "AAA,BBB,CCC"

Thanks
Jamie
0
Comment
Question by:jamie_lynn
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 39193011
sed -e "s/u\{0,1\}'//g" -e "s/[][]//g" <<END
 "[u'Kitts Corner', u'Jovita']", abc, "[u'AAA', u'BBB', u'CCC']"
END
0
 

Author Closing Comment

by:jamie_lynn
ID: 39195107
Works great!
Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now