<?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: Split input file into multiple outputs in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284883#M58505</link>
    <description>how to convert from string to double or long datatypes,plz help me</description>
    <pubDate>Wed, 25 Feb 2009 05:22:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-02-25T05:22:27Z</dc:date>
    <item>
      <title>Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284877#M58499</link>
      <description>Hi
&lt;BR /&gt;I am a newbie and have been unable to find the answer to my problem on the forum. Any help would be appreciated. 
&lt;BR /&gt;The scenario I need to resolve is as follows:
&lt;BR /&gt;Input file is a csv file which contains a batch header record followed by 'n' number of rows. The last record in the file is a simple batch trailer record. I need to split this single file into individual output files based on the content of the data in the rows including a dynamic file name, and recreate the new batch header and trailer records for each of the new files. The number of files created would vary based on the content of the original input file.
&lt;BR /&gt;eg
&lt;BR /&gt;input.txt
&lt;BR /&gt;BH,all animals
&lt;BR /&gt;mammal,cow
&lt;BR /&gt;reptile,cobra
&lt;BR /&gt;mammal,horse
&lt;BR /&gt;bird,sparrow
&lt;BR /&gt;reptile,crocodile
&lt;BR /&gt;BT,5
&lt;BR /&gt;Output for the above example assuming the split is on the first field would be:
&lt;BR /&gt;mammal.txt
&lt;BR /&gt;BH,mammal
&lt;BR /&gt;cow
&lt;BR /&gt;horse
&lt;BR /&gt;BT2
&lt;BR /&gt;reptile.txt
&lt;BR /&gt;BH,reptile
&lt;BR /&gt;cobra
&lt;BR /&gt;crocodile
&lt;BR /&gt;BT,2
&lt;BR /&gt;bird.txt
&lt;BR /&gt;BH,bird
&lt;BR /&gt;sparrow
&lt;BR /&gt;BT,1
&lt;BR /&gt;
&lt;BR /&gt;Any assistance in how to structure the JAVA job would be much appreciated.
&lt;BR /&gt;Regards
&lt;BR /&gt;Andre</description>
      <pubDate>Sat, 16 Nov 2024 14:25:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284877#M58499</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284878#M58500</link>
      <description>Hello
&lt;BR /&gt;I think it is difficult to create a file with the format as you said at one time. The line 'BH,mammal' should be written manually.
&lt;BR /&gt;Best regards
&lt;BR /&gt; shong</description>
      <pubDate>Fri, 28 Mar 2008 07:15:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284878#M58500</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-03-28T07:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284879#M58501</link>
      <description>Hi,
&lt;BR /&gt;We have some requirement, where file format is as given below:
&lt;BR /&gt;H,name,add1,add2(Header data - common to all records)
&lt;BR /&gt;C,xyz,1242654212,23.00 (details about payments)
&lt;BR /&gt;M,Refencedata1,client data1(Child record of its previous records)
&lt;BR /&gt;C,mno,124231987,874.00 (details about payments)
&lt;BR /&gt;C,pqr,1242312123,45343.00 (details about payments)
&lt;BR /&gt;M,Refencedata2,client data2(Child record of its previous records)
&lt;BR /&gt;T, 3(final record, the trailer)
&lt;BR /&gt;In the above file Header record data is common for all records, All main records may contain child records also and trailer record contains the count of total records excluding Header and Trailer record. I need to insert this data into a temporary table.
&lt;BR /&gt;Please suggest me how to map this file to a single table.
&lt;BR /&gt;Thanks....</description>
      <pubDate>Tue, 24 Feb 2009 06:54:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284879#M58501</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-24T06:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284880#M58502</link>
      <description>Hello guy
&lt;BR /&gt;What are your expected result? Are there some rule in your data?
&lt;BR /&gt;Best regards
&lt;BR /&gt; shong</description>
      <pubDate>Tue, 24 Feb 2009 07:38:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284880#M58502</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-24T07:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284881#M58503</link>
      <description>Hi Shong, 
&lt;BR /&gt;Thanks for your response. 
&lt;BR /&gt;Here is our requirement. 
&lt;BR /&gt;File will be in the given format: 
&lt;BR /&gt;H,name,add1,add2(Header data - common to all records) 
&lt;BR /&gt;C,xyz,1242654212,23.00 (details about payments) 
&lt;BR /&gt;M,Refencedata1,client data1(Child record of its previous records) 
&lt;BR /&gt;C,mno,124231987,874.00 (details about payments) 
&lt;BR /&gt;C,pqr,1242312123,45343.00 (details about payments) 
&lt;BR /&gt;M,Refencedata2,client data2(Child record of its previous records) 
&lt;BR /&gt;T, 3(final record, the trailer) 
&lt;BR /&gt;I have to parse it and insert into a temporary table (Ex: TempTable); 
&lt;BR /&gt;Each row will have Header Data,Payments Data, Child record data 
&lt;BR /&gt; Ex: name, add1, add2, xyz,1242654212,23.00, Refencedata1,client data1 
&lt;BR /&gt; name, add1, add2,mno,124231987,874.00 
&lt;BR /&gt; name, add1, add2,pqr,1242312123,45343.00,Refencedata2,client data2 
&lt;BR /&gt;I can do the data clean up etc. once I get the data in the temp table. So, I willn't apply any rules here. I am expecting the details like how to map this hierarchical file fields to table columns. 
&lt;BR /&gt;Thanks... 
&lt;BR /&gt;Hi Shong, any update on this; This is an urgent requirement as It would be great if you can help us on this.</description>
      <pubDate>Tue, 24 Feb 2009 08:05:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284881#M58503</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-24T08:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284882#M58504</link>
      <description>Hi Shong, 
&lt;BR /&gt;Any update on this; It would be great if you help us on this as this is an urgent requirement, . 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;Ashok</description>
      <pubDate>Wed, 25 Feb 2009 05:14:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284882#M58504</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-25T05:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284883#M58505</link>
      <description>how to convert from string to double or long datatypes,plz help me</description>
      <pubDate>Wed, 25 Feb 2009 05:22:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284883#M58505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-25T05:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284884#M58506</link>
      <description>Hi srinikpisoft,&lt;BR /&gt;please open a new thread if you have new question. This will also increase the chance to get an answer &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;To convert your string you should use Double.parseDouble() or Long.parseLong().&lt;BR /&gt;Bye&lt;BR /&gt;Volker</description>
      <pubDate>Thu, 26 Feb 2009 06:21:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284884#M58506</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-26T06:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284885#M58507</link>
      <description>Hi techinfo.forum80,&lt;BR /&gt;hope my answer in this thread will help you out: 1473&lt;BR /&gt;Bye&lt;BR /&gt;Volker</description>
      <pubDate>Thu, 26 Feb 2009 06:23:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284885#M58507</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-26T06:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284886#M58508</link>
      <description>Hi Volker,
&lt;BR /&gt;Thanks a lot for your response.
&lt;BR /&gt;I have few questions:
&lt;BR /&gt;From the above file I have taken out Header and Trailer records and passed only remaining records (Payment records and its child records).
&lt;BR /&gt;How can we map it to the table:
&lt;BR /&gt;Ex: here is my file:
&lt;BR /&gt;H,name,add1,add2(Header data - common to all records)
&lt;BR /&gt;C,xyz,1242654212,23.00 (details about payments)
&lt;BR /&gt;M,Refencedata1,client data1(Child record of its previous records)
&lt;BR /&gt;C,mno,124231987,874.00 (details about payments)
&lt;BR /&gt;C,pqr,1242312123,45343.00 (details about payments)
&lt;BR /&gt;M,Refencedata2,client data2(Child record of its previous records)
&lt;BR /&gt;T, 3(final record, the trailer)
&lt;BR /&gt;After removing the header and footer, it will be:
&lt;BR /&gt;C,xyz,1242654212,23.00 (details about payments)
&lt;BR /&gt;M,Refencedata1,client data1(Child record of its previous records)
&lt;BR /&gt;C,mno,124231987,874.00 (details about payments)
&lt;BR /&gt;C,pqr,1242312123,45343.00 (details about payments)
&lt;BR /&gt;M,Refencedata2,client data2(Child record of its previous records)
&lt;BR /&gt;I have to parse it and insert into a temporary table (Ex: TempTable);
&lt;BR /&gt;Each row Payments Data and its Child record data
&lt;BR /&gt;Ex: xyz,1242654212,23.00, Refencedata1,client data1
&lt;BR /&gt; mno,124231987,874.00
&lt;BR /&gt; pqr,1242312123,45343.00,Refencedata2,client data2
&lt;BR /&gt;How can we implement this with talend components. I am expecting the information like how to map this with table column (either tMap or any other component)?
&lt;BR /&gt;Hope you got my question.
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Ashok.</description>
      <pubDate>Fri, 27 Feb 2009 07:37:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284886#M58508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-27T07:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Split input file into multiple outputs</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284887#M58509</link>
      <description>Hi Ashok, 
&lt;BR /&gt;do you have always one detail with a predefined mapping? 
&lt;BR /&gt;In this case you have two solutions (otherwise only the second one). 
&lt;BR /&gt;Solution one with "information transfer between two flows": 
&lt;BR /&gt;a)Read your file with tFileInputRegex ("^(.),(.*)$"). You now have two values: The row type and the data. 
&lt;BR /&gt;b) Split the stream in a tMap depending on the row type. The "C"-row must by the first in order. 
&lt;BR /&gt;c) In each output stream decompose data with tExtractDelimitedFields 
&lt;BR /&gt;d) In the flow of row "C" add a tJavaRow and set predefined context variables for your data you need in flow "M". (context.accountNumber= input_row.accountNumber for example) 
&lt;BR /&gt;e) In the flow of row "M" add a tJavaRow and add the values you need to the output (output_row.accountNumber= context.accountNumber). You must define the variables in the output schema (which will have mor than input). In this case you could ignore the warning appearing on tJavaRow. 
&lt;BR /&gt; 
&lt;BR /&gt;Bye 
&lt;BR /&gt;Volker</description>
      <pubDate>Fri, 27 Feb 2009 11:02:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Split-input-file-into-multiple-outputs/m-p/2284887#M58509</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-27T11:02:49Z</dc:date>
    </item>
  </channel>
</rss>

