You are not logged in.
Pages: 1
Hi AB,
When we recently required a CSV parser, I remembered that mORMot offered such a feature. We plugged in the CSVToRawUTF8DynArray function, but immediately started receiving issues. Some debugging revealed that blank field were ignored and investigating the code we saw:
procedure CSVToRawUTF8DynArray(CSV: PUTF8Char; var Result: TRawUTF8DynArray; Sep: AnsiChar = ',');
var s: RawUTF8;
begin
while CSV<>nil do begin
s := GetNextItem(CSV,Sep);
if s<>'' then begin
SetLength(Result,length(Result)+1);
Result[high(Result)] := s;
end;
end;
end;
The line:
if s<>'' then begin
seems like a bug to us, but I'm pretty sure you had some use case where you needed to ignore blank fields. This is, however, not part of the CSV standard (as much as CSV is a standard). Is there an alternative function to call or can we submit a fix?
Offline
Pages: 1