473,329 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,329 software developers and data experts.

BadZipfile error in xlsx2csv (https://github.com/dilshod/xlsx2csv)

Hi,
I am trying to convert .xlsx file to csv file using xlsx2csv methd(https://github.com/dilshod/xlsx2csv) but I am getting following error:
Traceback (most recent call last):
File "C:\Program Files (x86)\eclipse-SDK-4.2.1-win32\eclipse\dropins\PyDev 2.7.1\plugins\org.python.pydev_2.7.1.2012100913\py src\pydev_runfiles.py", line 432, in __get_module_from_str
mod = __import__(modname)
File "C:\Users\nagesh\workspace\mtech_project__phase_2\ src\csvtodic.py", line 3, in <module>
xlsx2csv("mproduct.xlsx", open("mproduct_converted.csv", "w+"))
File "C:\Users\nagesh\workspace\mtech_project__phase_2\ src\xlsxtocsv.py", line 115, in xlsx2csv
ziphandle = zipfile.ZipFile(infilepath)
File "C:\Python27\lib\zipfile.py", line 714, in __init__
self._GetContents()
File "C:\Python27\lib\zipfile.py", line 748, in _GetContents
self._RealGetContents()
File "C:\Python27\lib\zipfile.py", line 763, in _RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file
ERROR: Module: csvtodic could not be imported (file: C:\Users\nagesh\workspace\mtech_project__phase_2\s rc\csvtodic.py).

Can anyone help?
Apr 11 '13 #1
2 2521
Rabbit
12,516 Expert Mod 8TB
I don't really know python but it sounds like you're trying to use a zip function and the file you're referencing for that function is not a zip file.

Of course, there's not much we can help you with if you don't post your code.
Apr 11 '13 #2
bvdet
2,851 Expert Mod 2GB
zipfile.BadZipFile is the exception raised by the zipfile module. I don't know enough about xlsx2csv to know why. The actual error may be masked in some way. The following does work:
Expand|Select|Wrap|Line Numbers
  1.     kwargs = {
  2.       'sheetid' : 0,
  3.       'delimiter' : ',',
  4.       'sheetdelimiter' : "--------",
  5.       'dateformat' : None,
  6.       'skip_empty_lines' : True
  7.     }
  8.     f = open("twolettercolumns.csv", 'w')
  9.     xlsx2csv("twolettercolumns.xlsx", f, **kwargs)
  10.     f.close()
Apr 11 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;...
14
by: Peter Chant | last post by:
I'm currently authenticating a site I have built using basic http authentication built into apache. This has zero overhead on php which is a bonus but it seems to not quite work how I'd like. ...
2
by: MarkAurit | last post by:
I have a web service Im using on a machine via http in a dmz that works file. Im now attempting to use it in a second server, this one using https. When I attempt to add the Web Reference in vs.net...
0
by: Jener Silva | last post by:
I have a Windows 2003 Enterprise server hosting my web service and it has the System cryptography set to run in FIPS complaint mode. When I try to run my asp.net application, which resides on...
0
by: txtoth | last post by:
I've got a web service client using mutualCertificate10Security talking to a Tomcat/Axis/WSS4J service over http. When I tried to get it to work over https I got the following error when trying to...
5
by: =?Utf-8?B?V2VsdVI=?= | last post by:
I have a web client application built on .Net Frameworks 2.0 that connects to a web service on IIS 6.0 via SSL and using X509 Client Certificates. At some locations (it works at others), I get the...
5
by: Chuck Anderson | last post by:
I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC (Windows XP). One of the scripts that I run daily needs to access a secure URL (https://..............). When I am running Php4,...
0
by: =?Utf-8?B?VGFoYQ==?= | last post by:
I am working on a C#.Net application that consumes a web service developped (by others) in Java. My application calls a web method to post a 64-bit binary file to the web service. The...
0
by: brian.freyle | last post by:
Hi, i'm trying to configure a wcf service with https, but when I generate the wsdl , it contains the schemaLocation pointing to the service with the local name instead of the DNS (https://...
3
by: gnewman | last post by:
Is it necessary to have a certificate to do a redirect from HTTPS to HTTP. We want to handle people trying to use HTTPS which we don't support, to HTTP. They currently get a "Page Not Found" error...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.