Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #41264 > unrolled thread
| Started by | s.arun316@gmail.com |
|---|---|
| First post | 2013-03-15 04:33 -0700 |
| Last post | 2013-03-16 15:49 -0400 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.python
Im fetching data from excel using python code.. i could see some junk value also with it. s.arun316@gmail.com - 2013-03-15 04:33 -0700
Re: Im fetching data from excel using python code.. i could see some junk value also with it. dieter <dieter@handshake.de> - 2013-03-16 07:50 +0100
Re: Im fetching data from excel using python code.. i could see some junk value also with it. Joel Goldstick <joel.goldstick@gmail.com> - 2013-03-16 15:49 -0400
| From | s.arun316@gmail.com |
|---|---|
| Date | 2013-03-15 04:33 -0700 |
| Subject | Im fetching data from excel using python code.. i could see some junk value also with it. |
| Message-ID | <0fa3b412-b9e8-4312-8cb4-db3ba3b3b2ca@googlegroups.com> |
Hi im fetching data from excel using python code.. i could see some junk value also with it. like [text:u
How to remove it.. below is the code
<code>
from xlrd import open_workbook
from win32com.client import Dispatch
book = open_workbook('C:/Users/742123/Desktop/test.xls')
sheet0 = book.sheet_by_index(0)
#sheet1 = book.sheet_by_index(1)
print sheet0.col(0)
print sheet0.col(2)
print sheet0.col(3)
print sheet0.col(4)
print sheet0.col(5)
print sheet0.col(6)
print sheet0.col(7)
print sheet0.col(8)
print sheet0.col(9)
print sheet0.col(10)
print sheet0.col(12)
print sheet0.col(13)
print sheet0.col(14)
print sheet0.col(15)
print sheet0.col(16)
print sheet0.col(17)
print sheet0.col(18)
print sheet0.col(19)
print sheet0.col(20)
print sheet0.col(21)
print sheet0.col(22)
print sheet0.col(23)
print sheet0.col(24)
print sheet0.col(25)
print sheet0.col(26)
print sheet0.col(27)
</code>
[toc] | [next] | [standalone]
| From | dieter <dieter@handshake.de> |
|---|---|
| Date | 2013-03-16 07:50 +0100 |
| Message-ID | <mailman.3356.1363416653.2939.python-list@python.org> |
| In reply to | #41264 |
s.arun316@gmail.com writes:
> Hi im fetching data from excel using python code.. i could see some junk value also with it. like [text:u
>
> How to remove it.. below is the code
It is very difficult to extract data reliably from an undocumented binary
format (such as "excel" files): things can change between versions,
some "features" may be used only in particular situations
difficult to get at by reverse engineering,
lacking a complete documentation completeness is difficult to get.
I see two options for you:
* send a problem report with your data to the "xlrd" author
He may know how to fix it.
* Tell "excel" to export the file to "csv" and
use Python's "csv" mode to read the values.
[toc] | [prev] | [next] | [standalone]
| From | Joel Goldstick <joel.goldstick@gmail.com> |
|---|---|
| Date | 2013-03-16 15:49 -0400 |
| Message-ID | <mailman.3371.1363463351.2939.python-list@python.org> |
| In reply to | #41264 |
[Multipart message — attachments visible in raw view] — view raw
On Sat, Mar 16, 2013 at 2:50 AM, dieter <dieter@handshake.de> wrote: > s.arun316@gmail.com writes: > > > Hi im fetching data from excel using python code.. i could see some junk > value also with it. like [text:u > I used the xlrd module some time back. I think if you google for tutorial on it you will find your answer > > > > How to remove it.. below is the code > > It is very difficult to extract data reliably from an undocumented binary > format (such as "excel" files): things can change between versions, > some "features" may be used only in particular situations > difficult to get at by reverse engineering, > lacking a complete documentation completeness is difficult to get. > This isn't true. The xlrd module takes care of this > > I see two options for you: > > * send a problem report with your data to the "xlrd" author > > He may know how to fix it. > > * Tell "excel" to export the file to "csv" and > use Python's "csv" mode to read the values. > I agree, that this is a simpler aproach > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web