Page 1 of 1

Reading multiple xlsx files

Posted: Fri Jun 09, 2017 5:51 am
by deesh
Hi,

My requirement also same like this requirement, getting multiple .xlsx files.
Can i know how the template looks?

My requirement :

1. Getting multiple files and read it into text file
2. In target we have max 100 columns, but each file has different column counts,
Example: file1 contains 10 columns, File2 contains 15 columns, File3 contains 100 columns.
3. .xlsx file header(column) contains spaces and special char, how to handle it.

Do you have an idea please help out to us.

Posted: Fri Jun 09, 2017 7:08 am
by chulett
:!: Split you out into your own topic.

Posted: Fri Jun 09, 2017 12:35 pm
by UCDI
1) do you have the unstructured file stage that can read/write excel? If not, do you have a way to read from excel? Excel itself can write to a database directly, if you wanted to use a stage-table approach. You could also dump the excel to csv files, those are simple to handle.

2) this seems easy enough... you just need a way to relate the data across the files, whether that is row 1 = row 1 across files or some key etc.

3) There are all kinds of string processing functions that can handle specific or general problems like this. Rename the column by dropping/replacing the bad characters might be all you need, and simple to do.

Posted: Fri Jun 09, 2017 8:28 pm
by ray.wurlod
UCDI wrote:1) do you have the unstructured file stage that can read/write excel?
Not in version 8.

In version 8 you will need to save in CSV format, and read that, or use an ODBC driver for Microsoft Excel that is compatible both with DataStage version 8 and the .xlsx format for Excel. (And there are strict format rules when using ODBC.)