LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Urgent (https://www.linuxquestions.org/questions/linux-newbie-8/urgent-4175510090/)

rajakt 07-04-2014 07:21 AM

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.

syg00 07-04-2014 07:30 AM

How is this in any way urgent ?.
And it looks like a duplicate post.

lpwevers 07-04-2014 07:32 AM

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

jeremy 07-04-2014 10:57 AM

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.


All times are GMT -5. The time now is 12:56 AM.