Read a xlsx file and save each sheet into a new file

Highlighted
Five Stars

Read a xlsx file and save each sheet into a new file

Hi folks,

I have a xlsx file that has many sheets, i need to read this sheets and put each sheet into a text file.

I've made a solution, but it doesn't work, because this solution create empty files.

 

My solution is:
tFileInputExcel --> Iterate --> tJava --> Main --> tFileOutputDelimited

 

tFileInputExcel is getting all sheets with dynamic schema;

tJava changes the output file name including sheet name as suffix of name;

tFileOutputDelimited only writes to disk with option append enabled;

 

* This solution needs a dynamic schema, i'll use it for all kind of xls files into my application.

 

Can someone help me with this solution?

 

Tags (1)

Accepted Solutions
Five Stars

Re: Read a xlsx file and save each sheet into a new file

Hi,
Only for spread knowledgement, i will share my solution here:

I created this sequence of components

tFileList (listing all xls files into a folder) --> Iterate
tJava (this componente call a routine class that i made, it read the current xls file, read the name of all sheets and put a list into global variables) --> Iterate
tLoop (looping through quantity of sheets) --> Iterate
tJava (get the name of current sheet and fill a context variable) --> Iterate

tFileInputExcel (read the excel file, the name of sheet is a context variable) --> Main

tFileOutputDelimited (write on disk the file with dynamic schema, the name of file are dynamic)

 

Well, if anyone has doubt about this solution, let me know.


All Replies
Five Stars

Re: Read a xlsx file and save each sheet into a new file

Hi,
Only for spread knowledgement, i will share my solution here:

I created this sequence of components

tFileList (listing all xls files into a folder) --> Iterate
tJava (this componente call a routine class that i made, it read the current xls file, read the name of all sheets and put a list into global variables) --> Iterate
tLoop (looping through quantity of sheets) --> Iterate
tJava (get the name of current sheet and fill a context variable) --> Iterate

tFileInputExcel (read the excel file, the name of sheet is a context variable) --> Main

tFileOutputDelimited (write on disk the file with dynamic schema, the name of file are dynamic)

 

Well, if anyone has doubt about this solution, let me know.

Six Stars

Re: Read a xlsx file and save each sheet into a new file

could you please attach the job export here, if you have the same with routine?

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads