<?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: CSV File Schema Column order in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239800#M27482</link>
    <description>I think this post might be what you need....&lt;BR /&gt;&lt;A href="http://www.talendforge.org/forum/viewtopic.php?pid=30540" rel="nofollow noopener noreferrer"&gt;http://www.talendforge.org/forum/viewtopic.php?pid=30540&lt;/A&gt;</description>
    <pubDate>Mon, 28 Jun 2010 22:06:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-06-28T22:06:14Z</dc:date>
    <item>
      <title>CSV File Schema Column order</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239797#M27479</link>
      <description>I have bunch of .csv files. I need to make sure that the columns are in the correct order when they load in the database. Sometime the vendor might switch columns that are similar. (I am using tfileinputDelimited for the. csv file) 
&lt;BR /&gt;for example. 
&lt;BR /&gt;correct: 
&lt;BR /&gt;firstname, lastname 
&lt;BR /&gt;ryan, smith 
&lt;BR /&gt;but if out of order: 
&lt;BR /&gt;lastname, firstname 
&lt;BR /&gt;smith, ryan 
&lt;BR /&gt;I need this last one to be stopped and an error telling me that the columns are out of order. 
&lt;BR /&gt;How can I do this with a .csv file? 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;Ryan 
&lt;BR /&gt;(Using Java)</description>
      <pubDate>Sat, 16 Nov 2024 13:22:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239797#M27479</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: CSV File Schema Column order</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239798#M27480</link>
      <description>I think the only way you could do it would be to read the header row of the file as one string (tFileInputFullRow), tNormalize it so each field name becomes a record, assign a sequence number and compare it to a file or table that contains the expected schema sequence (tMap). 
&lt;BR /&gt;Getting fancy, you could even read the data from the file into a dummy table in your database (made up of all strings with field names Col1, Col2 etc) and then using the results of your comparison above, construct a SQL statement in tJavaRow that will allow you to retrieve the fields from that dummy table in the correct expected order (tInput) so that the rest of your job will work correctly.</description>
      <pubDate>Thu, 24 Jun 2010 00:47:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239798#M27480</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2010-06-24T00:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: CSV File Schema Column order</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239799#M27481</link>
      <description>have your expected column order in a file like 
&lt;BR /&gt;firstname 
&lt;BR /&gt;surname 
&lt;BR /&gt;load it into a variable object as a ArrayList- vExpCol 
&lt;BR /&gt;load file header - load into another varible obj as above - vCols 
&lt;BR /&gt;then in a tJavaRowFlex, 
&lt;BR /&gt;(create on top part) ArrayList - vRows 
&lt;BR /&gt;middle part 
&lt;BR /&gt;load all columns into a local 
&lt;BR /&gt;vRows 
&lt;BR /&gt;compare the two ArrayLists for the row columns 
&lt;BR /&gt;if different then load like: 
&lt;BR /&gt;outrow.firstname = vRows.get( vCols.lastIndexOf( "firstname" ) ) ; 
&lt;BR /&gt;use Excel to make this code. 
&lt;BR /&gt;this is not complete - i am travelling using the mobi.</description>
      <pubDate>Thu, 24 Jun 2010 08:24:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239799#M27481</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-06-24T08:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: CSV File Schema Column order</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239800#M27482</link>
      <description>I think this post might be what you need....&lt;BR /&gt;&lt;A href="http://www.talendforge.org/forum/viewtopic.php?pid=30540" rel="nofollow noopener noreferrer"&gt;http://www.talendforge.org/forum/viewtopic.php?pid=30540&lt;/A&gt;</description>
      <pubDate>Mon, 28 Jun 2010 22:06:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239800#M27482</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-06-28T22:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: CSV File Schema Column order</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239801#M27483</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;I think the only way you could do it would be to read the header row of the file as one string (tFileInputFullRow), tNormalize it so each field name becomes a record, assign a sequence number and compare it to a file or table that contains the expected schema sequence (tMap).&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;I have attached a screenshot of what you described. Is this what you had in mind? Here's the output from my job. 
&lt;BR /&gt;Starting job columncheck at 08:05 03/07/2010.
&lt;BR /&gt; connecting to socket on port 3785
&lt;BR /&gt; connected
&lt;BR /&gt;.-------+---------.
&lt;BR /&gt;|matched col order|
&lt;BR /&gt;|=------+--------=|
&lt;BR /&gt;|line |newColumn|
&lt;BR /&gt;|=------+--------=|
&lt;BR /&gt;|GroupID|1 |
&lt;BR /&gt;|Deleted|7 |
&lt;BR /&gt;'-------+---------'
&lt;BR /&gt;.-----------------+---------.
&lt;BR /&gt;| unmatched col order |
&lt;BR /&gt;|=----------------+--------=|
&lt;BR /&gt;|line |newColumn|
&lt;BR /&gt;|=----------------+--------=|
&lt;BR /&gt;|XAP_CreateDate |2 |
&lt;BR /&gt;|GroupName |3 |
&lt;BR /&gt;|GroupCreationDate|4 |
&lt;BR /&gt;|GroupCreator |5 |
&lt;BR /&gt;|AdvisoryGroup |6 |
&lt;BR /&gt;'-----------------+---------'
&lt;BR /&gt; disconnected
&lt;BR /&gt;Job columncheck ended at 08:05 03/07/2010.</description>
      <pubDate>Sat, 03 Jul 2010 13:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239801#M27483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-03T13:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: CSV File Schema Column order</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239802#M27484</link>
      <description>Pretty much although it might be more useful if tMap_2 left-joined only on the column name and the match output had a filter expression t.newColumn==row3.sequence. Then the nomatch output could include row3.sequence for comparison. 
&lt;BR /&gt;Note that in your example you only need the purple arrow selected for inner-join rejects but in my suggestion you need only the orange arrow selected for filter rejects.</description>
      <pubDate>Sun, 04 Jul 2010 02:33:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CSV-File-Schema-Column-order/m-p/2239802#M27484</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2010-07-04T02:33:28Z</dc:date>
    </item>
  </channel>
</rss>

