python


python: converting corrupt xls file


I have downloaded few sales dataset from a SAP application. SAP has automatically converted the data to .XLS file. Whenever I open it using Pandas library I am getting the following error:
XLRDError: Unsupported format, or corrupt file: Expected BOF record; found '\xff\xfe\r\x00\n\x00\r\x00'
When I opened the .XLS file using MSEXCEL it is shows a popup saying that the file is corrupt or unsupported extension do you want to continue when I clicked 'Yes' its showing the correct data. When I saved the file again as .xls using msexcel I am able to use it using Pandas.
So, I tried renaming the file using os.rename() but it dint work. I tried opening the file and removing \xff\xfe\r\x00\n\x00\r\x00, but then also it dint work.
The solution is to open MSEXCEL and save the file again as .xls manually, is there any way to automate this. Kindly help.


Related Links

how to get list of files on windows which have file size less than say 500mb?
“Command not found” when using python for shell scripting
Python object not overwritten when reinitialized in the for loop
Set new cookie between requests with Python Requests
matplotlib bwr-colormap, always centered on zero
numpy delete an array value (logical zero)
BeautifulSoup crawling cookies
Selenium get_screenshot_as_file vs get_screenshot_as_base64?
How to print or store a selected column using pandas
make sphinx viewcode show module sources
Strategies for HTML processing in Python: Ambiguous Characters
Detect Audio with Selenium Webdriver and Python
Python scripting for NetLogo?
Python: input file is output file
glcoud auth login doesn't ask for verification code
python - going from a stack trace to a tree

Categories

HOME
pug
shopify
visual-studio-2013
agile
reportportal
visualization
windows-store-apps
heap-memory
sbt-assembly
rocketmq
recyclerview
terrain
browserify
dropbox
uiactivityviewcontroller
onsen-ui2
image-recognition
public-key-encryption
typeahead
riak
ng-show
google-api-java-client
jni
richfaces
spring-ws
tarantool
go-cd
tflearn
skmaps
emv
excel-2013
version-numbering
upnp
xilinx-ise
bxslider
superscript
spreedly
hawtio
pycparser
passenger
pox
xen
vmd
jupyter-console
rkt
aqgridview
proof
walmart-electrode
mouseclick-event
applepayjs
udev
photon-controller
paas
vici
efxclipse
verbose
typhoon
rmongodb
bacnet
foxit
com-interop
yoothemes
cmocka
asymptote
integral
vine
apache-mina
uos
adobe-indesign
google-earth-plugin
orientation-changes
scala-2.11
java-collections-api
io.js
funkload
ksoap2
flash-cc
bigint
asp.net-mvc-scaffolding
html-form-post
qtgui
prng
android-4.0
hibernate3
law-of-demeter
msgbox
shared-objects
coff
iphone-sdk-3.2
plinq
microsoft.ink
gears





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm