|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
problem: I need to extract a numerical string from an excel worksheet, there are approx 200 worksheets in one folder the string is in the same location on each work sheet what is the best way to code this.
|
|
#2
|
|||
|
|||
|
You can do it quite easily using COM automation with the PyWin32 extensions (formerly called Win32All) which you can download from https://sourceforge.net/projects/pywin32/.
I suggest you get hold of the book "Python Programming on Win32" by Hammond and Robinson, since it has a whole chapter on controlling Excel from Python. Dave - The Developers' Coach |
|
#3
|
||||
|
||||
|
Alternativly, since you know where the value you want is within the file. You could always open the file, grap be value (using a slice or whatever) and convert it to and int(). Though i think what Dave said is probably the way to go.
Mark. |
|
#4
|
||||
|
||||
|
The data is not going to be easy to find by scanning the file and impossible if it is the result of some calculation.
You need to extract the data after the spreadheet has been "rendered". DevCoach's solution is the only practical python way. grim ![]()
__________________
*** Experimental Python Markup CGI V2 *** |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > file io |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|