I am trying to print only the matched pattern in a CSV file. Example: all the columns value starting with 35=its value
. Thanks.
CSV file:
35=A,D=35,C=129,ff=136
D=35,35=BCD,C=129,ff=136
900035=G,D=35,C=129,ff=136
35=EF,D=35,C=129,ff=136,35=G
36=o,D=35,k=1
Output:
35=A
35=BCD
35=EF
35=G
The command I used did not work:
sed -n '/35=[A-Z]*?/ s/.*\(35=[A-Z]*?\).*/\1/p' filename
sed -e 'y/,/\n/; /^35=/P; D' filename