<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Some values in column defined as String are getting converted to timestamps in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266113#M45440</link>
    <description>&lt;P&gt;Since I don't see any quick fixes, here's part of my dateroutine to convert the excel date into a normal date. You can pretty easily convert this to a method and use it in a tJavaRow component.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;	/**
	 * convertExcelDate: Takes the input date (String) and expected
	 * date format and converts the date into that format.
	 * 
	 * 
	 * {talendTypes} String
	 * 
	 * {Category} User Defined
	 * 
	 * {param} string("inputDate") input: The string representation of the Excel date you want converted.
	 * 
	 * {param} string("ouputDateFormat") input: The format that you want the date in.
	 * 
	 * {example} stringToInt("THU MAR 08 00:00:00 EST 1990", "yyyyMMdd") # 19900308.
	 */
	public static String convertExcelDate(String inputDate, String outputDateFormat) {
		if(inputDate != null &amp;amp;&amp;amp; inputDate.replaceAll("\\W", "").length()&amp;gt;0){
			try{
				DateFormat inDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
				DateFormat outDateFormat = new SimpleDateFormat(outputDateFormat);
				Date inDate = inDateFormat.parse(inputDate);
				String outDate = outDateFormat.format(inDate);
				return(outDate);
			}
			catch(ParseException e){
				return "" + e;
			}
		} else {
			return "";
		}
	}&lt;/PRE&gt;</description>
    <pubDate>Wed, 25 Mar 2020 20:11:06 GMT</pubDate>
    <dc:creator>Jj5</dc:creator>
    <dc:date>2020-03-25T20:11:06Z</dc:date>
    <item>
      <title>Some values in column defined as String are getting converted to timestamps</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266109#M45436</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an Excel file with a column named DATE_MADE. This is very messy data and most values in this column cannot cleanly be converted to a real date type, so in my schema, I have defined the data type for this column as string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have set up a very simple job with tFileInputExcel as input and tLogRow as output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tLogRow schema has the DATE_MADE column defined as a string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I expected all the data in the DATE_MADE column to be passed through without transformation, as a string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With an input value of "ca. 1952", that's what I'm seeing in my tLogRow output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, with an input value of "1950/02/01" I'm seeing the following in my tLogRow output, which is unexpected and undesirable: "Wed Feb 01 00:00:00 EST 1950"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I get it to leave these values alone?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 22:11:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266109#M45436</guid>
      <dc:creator>kspurgin</dc:creator>
      <dc:date>2020-03-24T22:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Some values in column defined as String are getting converted to timestamps</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266110#M45437</link>
      <description>&lt;P&gt;This is an issue with Excel, not Talend. Excel will set a date in the format "EEE MMM dd HH:mm:ss z yyyy" but when viewed in Excel it will look like a normal short date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can provide an easy work-around, what I did in my job is create a routine to convert Excel dates and called it if the date.length() &amp;gt; 10.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 22:16:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266110#M45437</guid>
      <dc:creator>Jj5</dc:creator>
      <dc:date>2020-03-24T22:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Some values in column defined as String are getting converted to timestamps</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266111#M45438</link>
      <description>&lt;P&gt;Thanks to you for being quickly helpful!&lt;/P&gt; 
&lt;P&gt;No thanks to Excel for being unhelpfully "helpful".&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Easy workarounds happily accepted if anyone has them.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The client originally sent CSVs, where yep, I can see the value there is "01-FEB-50". But the client also has HTML and line breaks inside column values in the CSV, and I was having trouble getting those files to parse into rows correctly at all. Always something...&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 22:33:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266111#M45438</guid>
      <dc:creator>kspurgin</dc:creator>
      <dc:date>2020-03-24T22:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Some values in column defined as String are getting converted to timestamps</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266112#M45439</link>
      <description>You open the cab file in notepad++ and is what was the format you are having. You will see different format when you open in excel that can file</description>
      <pubDate>Wed, 25 Mar 2020 00:53:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266112#M45439</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2020-03-25T00:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Some values in column defined as String are getting converted to timestamps</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266113#M45440</link>
      <description>&lt;P&gt;Since I don't see any quick fixes, here's part of my dateroutine to convert the excel date into a normal date. You can pretty easily convert this to a method and use it in a tJavaRow component.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;	/**
	 * convertExcelDate: Takes the input date (String) and expected
	 * date format and converts the date into that format.
	 * 
	 * 
	 * {talendTypes} String
	 * 
	 * {Category} User Defined
	 * 
	 * {param} string("inputDate") input: The string representation of the Excel date you want converted.
	 * 
	 * {param} string("ouputDateFormat") input: The format that you want the date in.
	 * 
	 * {example} stringToInt("THU MAR 08 00:00:00 EST 1990", "yyyyMMdd") # 19900308.
	 */
	public static String convertExcelDate(String inputDate, String outputDateFormat) {
		if(inputDate != null &amp;amp;&amp;amp; inputDate.replaceAll("\\W", "").length()&amp;gt;0){
			try{
				DateFormat inDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
				DateFormat outDateFormat = new SimpleDateFormat(outputDateFormat);
				Date inDate = inDateFormat.parse(inputDate);
				String outDate = outDateFormat.format(inDate);
				return(outDate);
			}
			catch(ParseException e){
				return "" + e;
			}
		} else {
			return "";
		}
	}&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Mar 2020 20:11:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266113#M45440</guid>
      <dc:creator>Jj5</dc:creator>
      <dc:date>2020-03-25T20:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Some values in column defined as String are getting converted to timestamps</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266114#M45441</link>
      <description>&lt;P&gt;Thanks so much for sharing this. I'm just getting started with this tool, but this will be quite helpful in figuring out how to do custom functions. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 22:36:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266114#M45441</guid>
      <dc:creator>kspurgin</dc:creator>
      <dc:date>2020-03-25T22:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Some values in column defined as String are getting converted to timestamps</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266115#M45442</link>
      <description>&lt;P&gt;Any time, getting used to it has some learning curve but it's great once you get the hang of it. Here's how to add a routine:&lt;BR /&gt;&lt;A href="https://community.qlik.com/s/article/ka03p0000006EZrAAM" target="_blank"&gt;https://community.talend.com/t5/Design-and-Development/Create-a-user-routine-and-call-it-in-a-Job/ta-p/21665&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 22:46:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Some-values-in-column-defined-as-String-are-getting-converted-to/m-p/2266115#M45442</guid>
      <dc:creator>Jj5</dc:creator>
      <dc:date>2020-03-25T22:46:57Z</dc:date>
    </item>
  </channel>
</rss>

