I have a file with multiple occurances of a string, I need to remove only one of the occurrences using a specific match. I cannot seem to get a good way of doing this, i keep removing all occurrences
sed -i "s/|item2//g"
file format:
"1234567890|item2",
"1234567895|item2",
"3454343345|item1|item2",
"7854343345|item1|item3",
"0454343555|item1|item4|item6",
What i need to do is to match the first set of numbers say 3454343345 then after this remove a specific string, like item2.
Output I am trying to get
"1234567890|item2",
"1234567895|item2",
"3454343345|item1|",
"7854343345|item1|item3",
"0454343555|item1|item4|item6",
sed
command ....