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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Fernandez
Creator II
Creator II

Transform xls to csv without knowing format

Hi,

 

A customer will release daily many xls files with different formats (number of columns can be different)  and I have to tranform them into csv files.

How can I do that without defining the schema of xls file into tFileInputExcel ?

 

Thanks

Labels (3)
5 Replies
Anonymous
Not applicable

You need to give more information I'm afraid. If you are converting them to CSV files, then it sounds like the XML files have at least one loop in them. Could there be more than one loop? What are the constraints that you are having to work within? I don't believe any of the standard Talend components will do this for you I'm afraid. However, you can almost certainly use a bit of Java to potentially achieve this.

Fernandez
Creator II
Creator II
Author

Hi @rhall

 

I have to convert XLS files and not XML files.

But I don't know the number of columns of each XLS file I will have to convert every day.

 

Anonymous
Not applicable

Sorry, I'm not firing on all cylinders today. XLS makes it easier. Do you know the maximum number of columns that could be received? If so, set up your input schema to be the maximum number of columns and inside your job whittle those down to only those which are populated with data. 

Fernandez
Creator II
Creator II
Author

Thanks for feedback.

 

But I don't see how to whittle those down to only those which are populated with data...

With which component between tFileInputExcel and tFileOuputDelimited ?

Anonymous
Not applicable

There isn't a component to do this, but you can do it with a bit of Java code. Using something like a tJavaFlex you can test the contents of each of the columns from left to right. The first one that is empty will be where your columns stop. Now if you want, you can prepare your CSV row while doing this and simply output 1 column from this component and send it to your output.