Im fetching data from excel using python code.. i could see some junkvalue also with it.

S

s.arun316

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>
 
D

dieter

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.
 
J

Joel Goldstick

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
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top