I need to transform a lot of data from multiple Excel files and export one standard big text file. I created an ODBC System DSN, and it work fine. But I have about 100 excel files, and I would like to develop an interface with a dropdown list with all the excel files in my directory, choose one, and import it. Any ideas how I could do that? I tried to create a File DSN, but Zope doesn't seem to detect it. With such a connection, I could change the connection string into the DSN file when needed. So: - Is it possible to connect to a File DSN ODBC from Zope? - Is there a better, cleaner solution I could try? Thanks! Jean-François Ménard Intranet DPAS Pratiques d'affaires et orientations * (514) 840-3000 poste 3939 * (514) 840-5585 * menard.jean-francois@hydro.qc.ca * 855 Ste-Catherine est, 6e étage Montréal, Qué. H2L 4P5
Hi Jean-Francois, I would import the Excel-Sheets into an RDBMS first and then use this to access your data. Regards Tino Wildenhain --On Montag, 14. Mai 2001 11:09 -0400 Menard.Jean-Francois@hydro.qc.ca wrote:
I need to transform a lot of data from multiple Excel files and export one standard big text file.
I created an ODBC System DSN, and it work fine. But I have about 100 excel files, and I would like to develop an interface with a dropdown list with all the excel files in my directory, choose one, and import it.
Any ideas how I could do that? I tried to create a File DSN, but Zope doesn't seem to detect it. With such a connection, I could change the connection string into the DSN file when needed.
So:
- Is it possible to connect to a File DSN ODBC from Zope?
- Is there a better, cleaner solution I could try?
Thanks!
Jean-François Ménard Intranet DPAS Pratiques d'affaires et orientations * (514) 840-3000 poste 3939 * (514) 840-5585 * menard.jean-francois@hydro.qc.ca * 855 Ste-Catherine est, 6e étage Montréal, Qué. H2L 4P5
[Menard.Jean-Francois@hydro.qc.ca>] I created an ODBC System DSN, and it work fine. But I have about 100 excel files, and I would like to develop an interface with a dropdown list with all the excel files in my directory, choose one, and import it. Any ideas how I could do that? I tried to create a File DSN, but Zope doesn't seem to detect it. With such a connection, I could change the connection string into the DSN file when needed. [Tom] If you always know where the files are located, you could use the LocalFS product. Or you could write a simple python external method. Cheers, Tom P
Hi Thomas, --On Montag, 14. Mai 2001 11:44 -0400 "Thomas B. Passin" <tpassin@mitretek.org> wrote:
[Menard.Jean-Francois@hydro.qc.ca>]
I created an ODBC System DSN, and it work fine. But I have about 100 excel files, and I would like to develop an interface with a dropdown list with all the excel files in my directory, choose one, and import it.
Any ideas how I could do that? I tried to create a File DSN, but Zope doesn't seem to detect it. With such a connection, I could change the connection string into the DSN file when needed.
[Tom] If you always know where the files are located, you could use the LocalFS product. Or you could write a simple python external method.
Cheers,
You know of a python toolkit to handle Excel data? I would like to hear from it :) Regards Tino
[Tino Wildenhain]
You know of a python toolkit to handle Excel data? I would like to hear from it :)
Not exactly, but there are two ways to go (at least). 1) Access the spreadsheet through an odbc driver, using one of the python odbc database packages, like mxodbc. Then you shouldn't have any trouble with dynamically-generated connection strings. mxodbc is easy to use. If you went this route, you'd probably want to return the data to Zope in the form of lists or dictionaries, and do your display and styling using Zope. 2) Install the Windows COM extensions (I presume they will work with Zope, although I don't positively know that). Then you can use COM calls to talk to Excel and get the data that way. This assumes you are on a Windows platform, of course. You would access your python code through an external method with either approach. That method should do nothing more than pass some REQUEST form data to your code and return the resuls to Zope, if at all possible. Still, there must be a reasonable way to programatically change the DSN string in a zsql method, even though I don't know how. As I recall, that was what your original question was about. Then you wouldn't need all the external python stuff (might end up being easier, though, depending on what you want to do). Cheers, Tom P
Hi Thomas, I was not the original requester ;) Instead I pointed out earlyer to move all the stuff into an RDBMS instead keeping them in Excel files where they are definitively misplaced. And yes, users can be trained to change their working style :) Regards Tino Wildenhain --On Mittwoch, 16. Mai 2001 15:45 -0400 "Thomas B. Passin" <tpassin@mitretek.org> wrote:
[Tino Wildenhain]
You know of a python toolkit to handle Excel data? I would like to hear from it :)
Not exactly, but there are two ways to go (at least).
1) Access the spreadsheet through an odbc driver, using one of the python odbc database packages, like mxodbc. Then you shouldn't have any trouble with dynamically-generated connection strings. mxodbc is easy to use. If you went this route, you'd probably want to return the data to Zope in the form of lists or dictionaries, and do your display and styling using Zope.
2) Install the Windows COM extensions (I presume they will work with Zope, although I don't positively know that). Then you can use COM calls to talk to Excel and get the data that way. This assumes you are on a Windows platform, of course.
You would access your python code through an external method with either approach. That method should do nothing more than pass some REQUEST form data to your code and return the resuls to Zope, if at all possible.
Still, there must be a reasonable way to programatically change the DSN string in a zsql method, even though I don't know how. As I recall, that was what your original question was about. Then you wouldn't need all the external python stuff (might end up being easier, though, depending on what you want to do).
Cheers,
Tom P
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Menard.Jean-Francois@hydro.qc.ca -
Thomas B. Passin -
Tino Wildenhain