This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Can you do anything about the format of the input? This seems to need almost a full-fledged CSV parser, and even then might not be perfect. Particularly, can you avoid or at least somehow escape the inner quotation marks, or use something other than a quotation mark to signify strings with whitespace? (It would be much easier if there's at least one specific character which only means "until this occurs again, treat everything as belonging to the same column".)
–
Michael KjörlingJul 22 '13 at 11:23