I have a UniversalDataReader taking in a CSV using | delimiters in UTF-16 format
The out port metadata was built off of a table from MySQL and has string, long, integer, boolean, and date fields within it. I’ve had trouble getting the file to parse, so rolled the metadata back to all string and started rolling each type back in with trash files off of both ports so I can see the detail messages.
Two types are giving me some problems.
the file has boolean data as “False” or “True” and date data down to the millisecond.
These are the two errors I’m receiving:
…(date) cannot be set to “2009-06-18 10:35:14.173000000” - doesn’t match defined format “yyyy-MM-dd HH:mm:ss.S” in field # 10 of record # 5, value: ‘2009-06-18 10:35:14.173000000’
…(boolean) cannot be set to “False” - - doesn’t match defined True/False format “T|TRUE|YES|Y|t|true|1|yes|y” / “F|FALSE|NO|N|f|false|0|no|n” in field # 5 of record # 1, value: ‘False’
That was the approach I had settled on for the booleans. The source supplied milliseconds, but we really aren’t interested in that value and as a result I discovered that a format of ‘yyyy-MM-dd HH:mm:ss’ or ‘yyyy-MM-dd’ can still read those fields in as date, it just truncates off the extraneous information.
Thank you for getting a complete solution back to me. My apologies for the dup on the boolean question - I didn’t realize that the first post actually went through.
Good and helpful information. I have a similar scenario, but my date is coming in as “MM/dd/yyyy” and I can’t seem to find a function that can read/transform this.
You can read such data either as date directly (Set metadata field to date and fill MM/dd/yyyy into field format property in this case.) or as string which can be retyped with str2date($in.0.input_date,“MM/dd/yyyy”) function in CTL (Here will be two kinds of metadata - the first one with string type field and the second one with date type field again with format set to MM/dd/yyyy).