[resolved] Slipt 1 CSV file(4.5 lac rows)into 5 CSV files each having 1 lac count

Six Stars

[resolved] Slipt 1 CSV file(4.5 lac rows)into 5 CSV files each having 1 lac count

Hi All,
i have a 445000 rows in my CSV file with Header and Footer, i want to split this file into five CSV files each having count of 1 lac, and i need to put header and footer for each split file. Also i need to rename (eg :-cm_customeraggregatedatahigh_22082014_1.csv)  the spit files using the talend job . please advice me with some example job.Below is my file format (example) also i attached the file.


HEADER
401|^1077564803|^329|^14/08/2014|^HolidayScore
401|^1077564525|^329|^14/08/2014|^Mosaic
402|^1077564578|^FALSE|^Cruise|^Hattrick
402|^1077564450|^FALSE|^Beach|^Hattrick
403|^1077564578|^FALSE|^Netshoes|^Liveside
404|^Accountant|^1077564666|^14/08/2014|^QualityCoordinator
404|^Accountant|^1077564810|^14/08/2014|^E
405|^1077564829|^7.20
405|^1077564450|^329
406|^1077564639|^GR|^Cdcll|^GR|^Blackstone|^van der Helm|^Marjorie|^van der Helm|^Food Colouring  Orange|^Pharmaceutical Research Analyst|^CombsCombs|^Codecall1|^BlueVale|^Flour  Corn Fine|^Food Colouring  Orange|^675 Loaf Driveway|^Blackstone|^Owenton|^Locksmith|^Oomega|^Deck Officer|^Ecolab Crystal Fusion|^8|^2|^9|^FlourCorn Fine|^Food Colouring|^Kennedy Manor
406|^1077564450|^GR|^Cdcll|^GR|^Blackstone|^van der Helm|^Marjorie|^van der Helm|^Food Colouring  Orange|^Pharmaceutical Research Analyst|^CombsCombs|^Codecall1|^BlueVale|^Flour  Corn Fine|^Food Colouring  Orange|^675 Loaf Driveway|^Blackstone|^Owenton|^Locksmith|^Oomega|^Deck Officer|^Ecolab Crystal Fusion|^8|^2|^9|^FlourCorn Fine|^Food Colouring|^Kennedy Manor
407|^1077564466|^Fbskins|^14/08/2014|^Fbskins
408|^1077564641|^14/08/2014
409|^1077564393|^Nehru|^Zephania|^Clarke|^Sales and Marketing|^14/08/2014
410|^1077564509|^Kevyn|^14/08/2014
411|^1077565078|^Ajnews|^14/08/2014
412|^1077564431|^FALSE
413|^1077563770|^BrandType1|^FALSE|^BO|^14/08/2014
413|^1077563771|^BrandType1|^TRUE|^BO|^14/08/2014
413|^1077563772|^BrandType1|^FALSE|^BO|^14/08/2014
413|^1077563773|^BrandType1|^FALSE|^BO|^14/08/2014
413|^1077563774|^BrandType1|^FALSE|^BO|^14/08/2014
414|^1077595244|^Unknown|^malc@malcelder.com|^TRUE|^AO|^14/08/2014
414|^1077593263|^Unknown|^markduncan72@tiscali.co.uk|^TRUE|^AO|^14/08/2014
414|^1077595822|^Unknown|^lucy_rollason@hotmail.co.uk|^TRUE|^AO|^14/08/2014
414|^1077592339|^Unknown|^martinlonghurst11@gmail.com|^FALSE|^AO|^14/08/2014
414|^1077596204|^Unknown|^maylou@hotmail.co.uk|^FALSE|^AO|^14/08/2014
415|^1077571579|^BrandType2|^FALSE|^AO|^14/08/2014
415|^1077572740|^BrandType2|^TRUE|^AO|^14/08/2014
415|^1077572741|^BrandType2|^FALSE|^AO|^14/08/2014
415|^1077572742|^BrandType2|^FALSE|^AO|^14/08/2014
415|^1077572743|^BrandType2|^TRUE|^AO|^14/08/2014
416|^1077564052|^Unknown|^1003450181|^BO|^14/08/2014
416|^1077565271|^Unknown|^1003450015|^BO|^14/08/2014
416|^1077564806|^Unknown|^1003449786|^BO|^14/08/2014
417|^1077624915|^Unknown|^oswal12@msn.com|^BO|^14/08/2014
418|^1077624923|^Unknown|^+448197757505|^BO|^03/01/2014
FOOTER|^18




Example_Data.txt_20140902-1747.txt
Seventeen Stars

Re: [resolved] Slipt 1 CSV file(4.5 lac rows)into 5 CSV files each having 1 lac count

What is a "lac" and in which way do you want to split:
Split a couple of rows or split columns?
At the moment I can hardly spot a structure in your CSV file example.

This forum is not the place where you can find such complex solutions as advice. Normally companies pay for this kind of help ;-)
You can ask some more Talend related questions but you ask for a complete solution and it would take hours to have a ready to use solution, sorry to much time effort for the most of us.

... and by the way, wrong forum! Your topic has nothing to do with the creation of components.
Six Stars

Re: [resolved] Slipt 1 CSV file(4.5 lac rows)into 5 CSV files each having 1 lac count

yes jlolling , i split the couple of rows.
i want to split an csv files into four separate csv files , my initial csv file has 400000 rows and i want to split first 100000 rows into file 1, and 2nd 100000 rows into file 2,.., like wise my last 100000 rows into file 4.  is it possible in talend ?  im new to talend , please advice . thanks in advance.
Eg :
 the below example data have 39 rows in it. from that 1 -10 rows in file 1, 11-20 in file 2 , 21-30 in file 3 and finally 31-39 in file 4.
Four Stars

Re: [resolved] Slipt 1 CSV file(4.5 lac rows)into 5 CSV files each having 1 lac count

Hi,
In tfileoutputDelimited component advaced settings you will find split output in several files option, just select that option
and enter the number of rows you want to put in each file in rows each output file option.

Regards,
Bhanu

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

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog