I would like to replace the contents of the 3rd column of a .CSV file (using awk) by looking for a specific string and replace with another string that has a single quote and copies the output of that into another file. Any advice on what am I doing wrong?
For instance:
column1, coluumn2, coulumn3, column4, column5
1, item1, WALMART, 2.39, 50
2, item2, TARGET, 4.99, 52
3, item3, SAMS CLUB, 8.19, 15
4, item4, KROGER, 12.49, 33
5, item6, WEGMANS, 32.69, 75
6, item6, TARGET, 12.99, 25
7, item7, SAMS CLUB, 8.19, 92
I tried using the below awk but doesn't work:
awk '{gsub("SAMS CLUB","SAM\'S CLUB",$3);print}' filename1 > filename2