Error: UnParseable date when using ParseDate

One Star

Error: UnParseable date when using ParseDate

Hi,

I have reading a column from a csv file that contains date. Talend by default reads it as string. e.g. "07/09/2009" that is reflected by a variable row 20.Last_Date.
I am using tMap to map this and convert this string into a date by writing "TalendDate.parseDate("MM/dd/yyyy",row20.Last_Date) ".
However it shows an error: Exception in component tMap_5
java.lang.RuntimeException: java.text.ParseException: Unparseable date: ""07/09/2009""

Please tell me how to convert this string into date.

Thanks!
Community Manager

Re: Error: UnParseable date when using ParseDate

Hello
Unparseable date: ""07/09/2009""

There are double quote enclose the source data, so you should use the csv format to extract the data, check 'CSV option' on tFileInputDelimited component.

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Error: UnParseable date when using ParseDate

I have checked the CSV option on tFileInputDelimited component but still it shows the same error. In the CSV option I have given Text enclosure as " " and Ecsape character as " ".
Please tell me how to sort it out.. its urgent!
Community Manager

Re: Error: UnParseable date when using ParseDate

Hello
Suppose the source data as:
"1","shong","07/09/2009"
the text enclosure and ecsape character should be """

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Error: UnParseable date when using ParseDate

Thanks Shong!
One Star

Re: Error: UnParseable date when using ParseDate

Hello

I am facing this issue with reading CSV when file contains records with blank fields like:
,,,,
"09-09-2012","05:50","THE TREACLE PEOPLE: Sounds Crazy!","Rosie and Wizzle bring the Professor's 'Sound Sponge' to town and then take popular music to extremes with recordings of everything from Tapper 'tapping' to Pendle 'policing' and Stirling the haggis 'haggissing'!<br />","R,S"

As shown above first like is a line containing blank fields.I have applied a filter in tMap on input linkas:
StringHandling.TRIM(row10.Date)!=""

and then in tMap we are parsing this date field which is the first field.
Still its throwing error as:
java.lang.RuntimeException: java.text.ParseException: Unparseable date: ""

Can anyone please help?
Seven Stars

Re: Error: UnParseable date when using ParseDate

Don't revive old topics for new questions.

You can't compare Strings with !=. Use !StringHandling.TRIM(row10.Date).equals("") or !StringHandling.TRIM(row10.Date).isEmpty(). Or just adjust the header setting of tFileInputDelimited to skip that row. And use the advanced settings of tFileInputDelimited to trim your input columns.
Seventeen Stars

Re: Error: UnParseable date when using ParseDate

+1 Don't revive old topics for new questions Smiley Happy
"==" with String return true only if String 1 & String 2 are the same object

regards
laurent

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download