I have an extremely large csv file that I need to search the second field, and upon matches update the last field...
I can pull the line with awk.. but apparently you cant use awk to directly update the file? So im curious if I can use sed to do this... The good news is the field I want to update is the last field, so I can just do a right to left search for "," and update to the right.
anyways, the details.
...
field1,X.X.X.X,feild3,...,field13
field1,X.X.X.X,feild3,...,field13
field1,X.X.X.X,feild3,...,field14 <This is the field I need to change
field1,X.X.X.X,feild3,...,field13
field1,X.X.X.X,feild3,...,field13
field1,X.X.X.X,feild3,...,field13
field1,X.X.X.X,feild3,...,field13
field1,X.X.X.X,feild3,...,field13
field1,X.X.X.X,feild3,...,field13
...
awk line to pull the info I want...
awk -v ip=$ip 'NF > 13 {if ($2 == ip && $14 =="*") print $0}' file.csv
now, besides turning the above into 3-4 long bash variables... Is there any easy way to change field $14 in the above line?