I would like to replace a handful of strings with others (e.g. “GG” with “GGX”, “GG ” with “GGX”, “FG” with “FGX”, etc) in the first column of a big csv file using a shell command.
I know I need something like
big.csv shell_commands big.csv
but I don’t know awk or sed
Using sed, replacing all instances of “GG” with “GGX” in
big.csvwould look like:If you need to replace multiple patterns, you can use multiple replace commands in sed separated by semicolons.
The
^character means beginning of line and ensures that we only edit the first field of the csv.