LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 07-04-2014, 07:21 AM   #1
rajakt
LQ Newbie
 
Registered: Jul 2014
Posts: 3

Rep: Reputation: 0
Urgent


Hi,

I have data in Linux as thus:

"aaa","aaa,vvvv,llll,kkk","bbbbb"
"g","pppp,kk,gg","caa,a,d,e,f","jjj,mmm,lll"


and want output as

aaa|aaa,vvvv,llll,kkk|bbbbb
g|pppp,kk,gg|caa,a,d,e,f|jjj,mmm,lll

Can you please let me know. I TRIED cut -d , awk ,sed simple one.
 
Old 07-04-2014, 07:30 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
How is this in any way urgent ?.
And it looks like a duplicate post.
 
Old 07-04-2014, 07:32 AM   #3
lpwevers
Member
 
Registered: Apr 2005
Location: The Netherlands
Distribution: SuSE, CentOS
Posts: 181

Rep: Reputation: 21
Hi,

Well, actually, because you named your topic urgent, I didn't want to reply. But since it's the newbie forum I'll forget about that for now. I've put your data in a file called data. Then something like this does the trick:
Code:
> cat data | sed 's/","/|/g' | sed 's/"//g'
aaa|aaa,vvvv,llll,kkk|bbbbb
g|pppp,kk,gg|caa,a,d,e,f|jjj,mmm,lll
Louis
 
Old 07-04-2014, 10:57 AM   #4
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,602

Rep: Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread



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



LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration