Pages: [1]
  Print  
Author Topic: Nominal2Date Unparseable date: "'2009-04-09 00:00:00'"  (Read 1077 times)
wessel
Hero Member
*****
Posts: 554


« on: June 11, 2009, 10:19:19 PM »

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)




Logged
wessel
Hero Member
*****
Posts: 554


« Reply #1 on: June 12, 2009, 12:09:43 AM »

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?
Logged
Tobias Malbrecht
Global Moderator
Sr. Member
*****
Posts: 293



WWW
« Reply #2 on: June 12, 2009, 10:40:06 AM »

Hi,

no, but you could replace the quotes by nothing using the Replace operator before:

Code:
<operator name="Replace" class="Replace">
    <parameter key="attributes" value="date"/>
    <parameter key="replace_what" value="&#39;"/>
</operator>

Kind regards,
Tobias
Logged

Tobias Malbrecht
Director of Product Marketing
RapidMiner
Pages: [1]
  Print  
 
Jump to: