testErrorPerLine_del[]l|del==Comma=Left(pack$"Too many fields at line "<>showl<>". Try using tabulation as a delimiter. Other delimiter like comma (,) may appear in some text.")
|otherwise=Left(pack$"Too many fields at line "<>showl)
testErrorPerLine[]__l=Left(pack$"Missing one field at line "<>showl)
-- | Parses the input 'ByteString' identifying a TSV document
-- using the provided delimiter. This function is /incremental/, i.e.
-- it will correctly identify rows which can't be parsed and skip them,
-- collecting the error along the way.
-- It returns a list of 'ParseCorpusResult', which will contain either
-- the parsed record or a diagnostic on the error on the given row.
parseTsvWithDiagnostics::Delimiter
->BL.ByteString
->[ParseCorpusResultTsvDoc]
parseTsvWithDiagnosticsdbs=
casedrainParser(BL.foldrChunksgomkHdrParserbs)of
MkHeaderParsingContext_p->
[ParseTsvRecordFailed(AtRow0("The parsing choked on the header (delimiter was "<>showd<>"). This might be a malformed TSV we can't recover from.",mempty))]
MkRecordParsingContext(RecordParsingContext{..})
-- As we accumulate records by consing (for efficiency sake),
[ParseTsvRecordFailed(AtRow0("The parsing choked on the header (delimiter was "<>showd<>"). This might be a malformed TSV we can't recover from.",mempty))]
MkRecordParsingContext(RecordParsingContext{..})
-- As we accumulate records by consing (for efficiency sake),
testErrorPerLine__del[]l|del==Comma=Left(pack$"Too many fields at line "<>showl<>". Try using tabulation as a delimiter. Other delimiter like comma (,) may appear in some text.")
|otherwise=Left(pack$"Too many fields at line "<>showl)
testErrorPerLine_[]__l=Left(pack$"Missing one field at line "<>showl)
elseLeft$("Encapsulation problem at line "<>pack(showligne)<>" in column '"<>columnHeader<>"' : the caracter \" must only appear at the beginning and the end of a field ")
elseLeft$("Encapsulation problem at line "<>pack(showlineno)<>" in column '"<>columnHeader<>"' : the caracter \" must only appear at the beginning and the end of a field ")
elsereturnTrue
elsereturnTrue
-- else Left $ ("The column '" <> columnHeader <> "' at line " <> pack (show ligne) <> " is empty")
-- else Left $ ("The column '" <> columnHeader <> "' at line " <> pack (show ligne) <> " is empty")
-- Put a warning for the user to know their is a problem (empty column)
-- Put a warning for the user to know their is a problem (empty column)