I’m using bash and wondering if there is a way to do a search and replace with given conditions. I have a CSV file with rows resembling the following …
Ira,Frances,Lancaster,373611,06211101,239661,239661,8,8/16/01
If the 6th and 7th columns contain the same values, I would like to replace the 7th column with an empty string, so the above would become
Ira,Frances,Lancaster,373611,06211101,239661,,8,8/16/01
I’m using Mac 10.9.5 with bash shell. What is the shortest way to edit the file to remove the data I want?