我需要從在了Talend開放工作室的工作下面的字符串解析第一日期:解析日期了Talend開放工作室引發錯誤
Report für Benutzerdefiniert Von: 11.10.2016 01:00:00 Bis: 12.10.2016 01:00:00
我建立下面的表達式,其在tjavarow組件中使用設置日期爲全局變量:
output_row.Datum = TalendDate.parseDate("dd.MM.yyyy",StringHandling.LEFT(StringHandling.FTRIM(StringHandling.EREPLACE(input_row.Column0,"Report für Benutzerdefiniert Von: ","")),11));
globalMap.put("datum",output_row.Datum);
但我只得到這個錯誤:
Exception in component tJavaRow_2
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "11.10.2016"
at routines.TalendDate.parseDate(TalendDate.java:895)
at routines.TalendDate.parseDate(TalendDate.java:839)
at ec_bi.xxxx_logintimes_csv_to_db_0_1.xxxx_LoginTImes_CSV_to_DB.tFileInputDelimited_3Process(xxxx_LoginTImes_CSV_to_DB.java:3184)
at ec_bi.xxxx_logintimes_csv_to_db_0_1.xxxx_LoginTImes_CSV_to_DB.tJavaRow_1_error(xxxx_LoginTImes_CSV_to_DB.java:412)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at ec_bi.xxxx_logintimes_csv_to_db_0_1.xxxx_LoginTImes_CSV_to_DB$TalendException.printStackTrace(xxxx_LoginTImes_CSV_to_DB.java:355)
at ec_bi.xxxx_logintimes_csv_to_db_0_1.xxxx_LoginTImes_CSV_to_DB.runJobInTOS(xxxx_LoginTImes_CSV_to_DB.java:10195)
at xxx.xxxxxx_csv_to_db_0_1.xxxx_LoginTImes_CSV_to_DB.main(xxxx_xxxxx_CSV_to_DB.java:9946)
Caused by: java.text.ParseException: Unparseable date: "11.10.2016"
at java.text.DateFormat.parse(DateFormat.java:366)
at routines.TalendDate.parseDate(TalendDate.java:881)
... 10 more
什麼毛病我解析日期TalendDate.parseDate("dd.MM.yyyy",...)
值得慶幸的是
基督教
遺憾是複製/以前的錯誤 - 我正確地修正了兩個問題: output_row.Datum = TalendDate.parseDate(「dd.MM.yyyy」,StringHandling.LEFT(StringHandling.FTRIM(StringHandling.EREPLACE(input_row.Column0,「ReportfürBenutzerdefiniert Von:」, 「)),11));全局映射(「datum」,output_row.Datum); 但得到相同的錯誤 – chnet