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
Solved

How can I replace this string in sed?

Posted on 2013-05-23
2
330 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.

839 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