jeudi 2 avril 2015

BASH csv parsing using IFS=, where some fields contain the separator, ie an address


Vote count:

0




I'm trying to parse a csv file that gets generated from a MySQL database using IFS=,, but some of the fields contain a , that shouldn't be treated as a separator.


For instance, the first line is: "012345678","abcdefgh","Smith, John","1234 Main St. Somewhere, state"


What I'm getting in return is: "012345678","abcdefgh","Smith","John","1234 Main St. Somewhere","state"


I'm trying to assign each field to a variable, but the script is getting hung up on the commas that aren't actual field separators.



asked 1 min ago







BASH csv parsing using IFS=, where some fields contain the separator, ie an address

Aucun commentaire:

Enregistrer un commentaire