Nominal2Date Unparseable date: "'2009-04-09 00:00:00'"

wesselwessel Member Posts: 537 Maven
Dear All,

I have the following error, and I'm unsure why.
[Fatal] Process failed: Cannot parse the data in line 1 for attribute systime with the date format yyyy-MM-dd HH:mm:ss: Unparseable date: "'2009-4-9 00:00:00'"

I use the following data format:
yyyy-MM-dd HH:mm:ss

My CSV file looks like this:
systime
'2009-4-9 00:00:00'
'2009-4-9 01:00:00'
'2009-4-9 02:00:00'
'2009-4-9 03:00:00'
'2009-4-9 04:00:00'
'2009-4-9 05:00:00'
'2009-4-9 06:00:00'
'2009-4-9 07:00:00'
'2009-4-9 08:00:00'
'2009-4-9 09:00:00'
'2009-4-9 10:00:00'
'2009-4-9 11:00:00'
'2009-4-9 12:00:00'
'2009-4-9 13:00:00'
'2009-4-9 14:00:00'
'2009-4-9 15:00:00'
'2009-4-9 16:00:00'
'2009-4-9 17:00:00'
'2009-4-9 18:00:00'
'2009-4-9 19:00:00'
'2009-4-9 20:00:00'
'2009-4-9 21:00:00'
'2009-4-9 22:00:00'
'2009-4-9 23:00:00'
'2009-4-10 00:00:00'
'2009-4-11 01:00:00'

My error log like this:
  Root[1] (Process)
  +- CSVExampleSource[1] (CSVExampleSource)
  +- Nominal2Date[1] (Nominal2Date)
G Jun 11, 2009 11:14:21 PM: [Fatal] UserError occured in 1st application of Nominal2Date (Nominal2Date)
G Jun 11, 2009 11:14:21 PM: [Fatal] Process failed: Cannot parse the data in line 1 for attribute systime with the date format yyyy-MM-dd HH:mm:ss: Unparseable date: "'2009-4-9 00:00:00'"
          Root[1] (Process)
          +- CSVExampleSource[1] (CSVExampleSource)
here ==> +- Nominal2Date[1] (Nominal2Date)




Answers

  • wesselwessel Member Posts: 537 Maven
    I found out its the single quotes that make it ERROR.

    Any way to include the quotes in the pattern?

    Like: \'yyyy-MM-dd HH:mm:ss\' or something?
  • TobiasMalbrechtTobiasMalbrecht Moderator, Employee, Member Posts: 294 RM Product Management
    Hi,

    no, but you could replace the quotes by nothing using the [tt]Replace[/tt] operator before:

    <operator name="Replace" class="Replace">
        <parameter key="attributes" value="date"/>
        <parameter key="replace_what" value="&#39;"/>
    </operator>
    Kind regards,
    Tobias
Sign In or Register to comment.