Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to split text file in talend DI

I have 100000 lines of text file, how to split file in target folder as each text file of 100 lines each

Labels (2)
10 Replies
Anonymous
Not applicable
Author

on Linux/Unix use the split commd:

split <textfile> --lines=100
Anonymous
Not applicable
Author

Thanks for reply Robert,
Do we have any talend component to split file because I need to develop a job that should work for any platform.
Anonymous
Not applicable
Author

Hi,
There is an option 'Split output in several files' in the advanced setting tab of tFileOutputDelimid. You can generate N rows(100) in each file.

Feel free to let us know if it is what you are looking for.
Best regards
Sabrina
Anonymous
Not applicable
Author

Thanks for your reply,
But while writing from tFileList to tFileoutputdelimited, it writes only last file from directory.
Please give the solution to writes all files data from dir to target.
Please ref image attahced
Anonymous
Not applicable
Author

Hi praneeth31,

Have you tried to check out "Append" option in tFileoutputdelimited component to see if works?

Best regards
Sabrina
Anonymous
Not applicable
Author

Yes, I used Append selection at tFIleOutputDelimited!
refer diagram to check any mistake i did.
0683p000009MGxV.png
Anonymous
Not applicable
Author

Hi,
Could you please give us more descriptions about your job design?
We see the work flow:
tfileinputregex_1-->tfileouputdelimited_1(split your 100000 lines into 100 lines each? )-->oncomponentOk-->tfilelist-->iterate-->tfileinputregex_2-->tmap-->tfileoutputdelimited_2.
What's the purpose for subjob2? How did you set filemask on tfilelist component?

Best regards
Sabrina
Anonymous
Not applicable
Author

I didn't use any file masking, I just want to split file to dir, add all files using tFileList to target by adding new columns(I didn't used it now) using tMap.
0683p000009MGxe.png 0683p000009MGvU.png
preddy79
Contributor
Contributor

Hi,
I've similar job to pull 100000 from db into an outputfile to split each file with 1000 records. When the job generates a file it writes 100 files in 2 mins but it keeps writing again and again starts with file1 till file100 and continues for 1 hour. I dont understand why it is doing so...
When i write single file it completes in 5 mins... but when i split because of this over writing it is running for 1 hour. Can yu please help me why it is happening and how to fix it.
thanks