?
Solved

How can I replace this string in sed?

Posted on 2013-05-23
2
Medium Priority
?
334 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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.
Suggested Courses

649 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