I have a daily script that needs to extract an error log and remove users from the master csv file, before uploading into the database. I'm able to use awk to extract the first column with great results. However, the error I get back from my 3rd party application contains a comma in the error column. This is preventing an exact match and causing issues.
This is a sample of the error file I get back
"USER_ID","FIRSTNAME","LASTNAME","ERROR"
"CA781558","Dani","Roper","parent is inactive, cannot update record"
"BT055163","Alexis","Richardo","parent is inactive, cannot update record"
"LN764767","Peter","Rajosz","no parent record, update denied"
"SG839717","Jerry","Alindos","parent is inactive, cannot update record"
I need to match exactly for "parent is inactive, cannot update record", to use this to update the parent record, so it can be updated. Likewise, I need to match the "no parent record" so I can add a parent for this record and process. In reality, I have a slew of similar error messages that require different actions. Matching on the exact string, with the comma, is critical.
The expected output is:
"USER_ID"
"CA781558"
"BT055163"
"SG839717"