Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
We have multiple xlsb format files and I want to load all of them in a single table. I have created ODBC connection but I can not find similar thread on how to load multiple files in single table.
Kaushik.solanki I just see your threads regarding the xlsb format issue. Do you have any idea about this.?
Thank you in advance.
Hi Tamil,
I do not have a XLSB file can you attach a sample file.
Regards,
Jagan.
Hi,
Can you attach the script you are using to load single xlsb file, I will update the code with loop.
Regards,
Jagan.
Jagan,
Attached some sample files.
Code:
ODBC CONNECT32 TO [Excel Files;DBQ=C:\Users\Tamilarasu.Nagaraj\Desktop\New folder (3)\1.xlsb];
Table:
SQL SELECT *
FROM `C:\Users\Tamilarasu.Nagaraj\Desktop\New folder (3)\1.xlsb`.`'Sheet1$'`;
Need to create a ODBC connection.
Kindly have a look. Thank you.
Hi,
I asked you to attach the code for loading single XLSB file, so that I will update the code with the For loop.
Regards,
Jagan.
Please check now.
Hi,
Try this script
//to read each file from the specified folder
FOR EACH file in FileList('C:\Users\Tamilarasu.Nagaraj\Desktop\New folder (3)\*.xlsb');
//In order to get the file information from SQLtables command making use of the ODBC connection format
ODBC CONNECT32 TO [Excel Files;DBQ=$(file)];
Table:
SELECT *
FROM '$(file)'.'Sheet1$';
Next
Regards,
jagan.
HI,
If you got the answer close this thread by giving Correct Answer to the post which helps you in getting answer.
Regards,
jagan.
Jagan,
I was just checking my old threads and closing some of them. The solution which you have provided was really helpful but it did not read any xlsb files. I found an alternate solution and implemented the same in my application (Long back).
Tell how you solve this and mark your post as Correct Answer, so that it will be really helpful for people who are looking for this type of solution.
Regards,
Jagan.
I have lots of qvw files in my system and I don't know the correct one. Anyways, I just did a check of your code and found this is working (And marked your answer as correct too).
For Each vFile in Filelist('$(vFolder)*.xlsb')
ODBC CONNECT32 TO [Excel Files;DBQ=$(vFolder)\vFile.xlsb];
Consolidated:
SQL SELECT *
FROM `$(vFile)`.`Sheet1$`;
Next