Solved

How can I replace this string in sed?

Posted on 2013-05-23
2
327 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
Comment Utility
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
Comment Utility
Works great!
Thanks!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

762 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

14 Experts available now in Live!

Get 1:1 Help Now