I have a csv file looks like this:
c1,c2,c3,http://aaa.com/blblbblb\nhttp://bbb.com/sdsdsds\nhttp://ccc.com\nhttp://foo.com/ghghghgh
cc1,cc2,cc3,http://eee.com/blblbblb\nhttp://foo.com/sdsdsds\nhttp://fff.com\nhttp://ttt.com/ghghghgh
ccc1,ccc2,ccc3,http://foo.com/blblbblb\nhttp://vvv.com/sdsdsds\nhttp://foo.com/nmnmnmnm\nhttp://qqq.com\nhttp://kkk.com/ghghghgh
is it possible manipulate above csv file and export as follows: (using sed
or awk
or similar bash commands)
c1,c2,c3,http://foo.com/ghghghgh
cc1,cc2,cc3,http://foo.com/sdsdsds
ccc1,ccc2,ccc3,http://foo.com/blblbblb;http://foo.com/nmnmnmnm
Actually i want to manipulate only 4th column and Remain http://foo.com/{some string}
pattern (in other words, extract links from 4th column when contain foo.com domain)
\n
mean'newline'
?cat file.csv
?