SubtitlesParser icon indicating copy to clipboard operation
SubtitlesParser copied to clipboard

Parsing CSV type data with Split() has problems when 'Text' might contain commas

Open mshiels opened this issue 4 years ago • 2 comments

You need to limit the Split() to the number of columns from the header row and that should solve it.

mshiels avatar Nov 29 '21 03:11 mshiels

Can you point me to the line or file with this issue?

AlexPoint avatar Dec 04 '21 21:12 AlexPoint

Haha, now I gotta dig, this is a really common situation if your last piece of data can contain the separator itself, and I did research it, and sure enough ,s are allowed in the subtitle itself.

Haha, it would have also helped if I said I was parsing SSA/ASS right??

SsaParser line 98 - var columns = line.Split(SsaFormatConstants.SEPARATOR);

Really needs to limit the columns to the number of columns expected, that way a subtitle with ,s will still stay as one piece and not get lost.

mshiels avatar Dec 04 '21 23:12 mshiels