I want to split a stream of data on new lines that are NOT within double quotes. The stream contains rows of data, where each row is separated by a newline. However, the rows of data can potentially contain newlines within double quotes. These newlines do not signify that the next row of data has started, so I want to ignore them.
So the data might look something like this:
Row 1: bla bla, 12345, ...
Row 2: "bla
bla", 12345, ...
Row 3: bla bla, 12345, ...
I tried using regex from a similar post about splitting on commas not found with double quotes (Splitting on comma outside quotes) by replacing the comma with the newline character:
\n(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)
This regex doesn't match where I'd expect it to though. Am I missing something?