LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 08: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, 08:30 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,834

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

Rep: Reputation: 20
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, 11:57 AM   #4
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 11,957

Rep: Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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




All times are GMT -5. The time now is 03:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration