csv2sql
csv2sql copied to clipboard
Date time parsing fails due to bad characters
The following rows lead to an error like
Error:
%FunctionClauseError{
args: nil,
arity: 2,
clauses: nil,
function: :fixed_integer_impl,
kind: nil,
module: Combine.Parsers.Text
}
Data:
"a080W00001U6ghZQAR","0","SCH-0317-116982","2017-03-22 11:08:42","005d0000001KYMqAAO","2017-03-22 11:08:42","005d0000001KYMqAAO","2017-03-22 11:08:42","0030W00003Kn7kTQAR","0","Master","","","�vora University","masters","","Contemporary Art History","1"
This happens due to a bad character � in the data "�vora University".
It fails in the call to Timex.parse(item, pattern) in apps/csv2sql/lib/csv2sql/schema_maker.ex line 209 and 213
Note to self: Maybe wrap calls to Timex in try catch to get rid of such issues