0

Can anyone explain me the below and please tell me why it is not accepting large number of strings.

sed ':a;s/(([^,|]+)[|,].*)\2/\1/;ta;y/,/|/;s/||/|/g' file_nm
2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by Pooja#
0

what do you call Ā«not accepting large number of stringsĀ»?

give us a representative input sample,
what the command outputs,
and what it should output.

0

My Input File:

AA|BB|CC
a@gmail.com,c@yahoo.co.in|a@gmail.com|a@gmail.com,g@gmail.com,d@gmail.com
y@gmail.com|x@yahoo.in,z@redhat.com|z@redhat.com
c@gmail.com|b@yahoo.co.in|c@uix.xo.in
c@gmail.com|b@yahoo.co.in|c@gmail.com,b@yahoo.co.in
by@gmail.com|by@gmail.com|ww@gmail.com

Out is coming after running the **sed ':a;s/(([^,|]+)[|,].*)\2/\1/;ta;y/,/|/;s/||/|/g' file_nm **

OutPut:
`

AA|BB|CC
a@gmail.com|c@yahoo.co.in||g|d
y@gmail.com|x@yahoo.in|z@redhat|
c@gmail.com|b@yahoo.co.in|c@uix.x
c@gmail.com|b@yahoo.co.in|
by@gmail.com|ww

`

Expected Output:

AA|BB|CC
a@gmail.com|c@yahoo.co.in|g@gmail.com|d@gmail.com
y@gmail.com|x@yahoo.in|z@redhat.com
c@gmail.com|b@yahoo.co.in|c@uix.xo.in
c@gmail.com|b@yahoo.co.in
by@gmail.com|ww@gmail.com
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.