I have Python 2.6.6 version and I don't have access to install new modules like pandas,xlrd,xlwt.
I want to read Excel using Python . Is it possible to read Excel using Python with default modules present in Python.
I have Python 2.6.6 version and I don't have access to install new modules like pandas,xlrd,xlwt.
I want to read Excel using Python . Is it possible to read Excel using Python with default modules present in Python.
Based on this link: http://davis.lbl.gov/Manuals/PYTHON/library/csv.html
you should be able to use reader
and writer
commands by importing csv. You can also define different delimiters:
import csv
FileReader = csv.reader(open('FileName.csv', 'rb'), delimiter=' ',quotechar='|')
Moreover, you can map the data you are reading into a dict using DictReader
.
1) if you are using an IDE ex. PyCharm then you can drag an drop the file in your workspace or project and open it like this --> open("myfile.csv")
it will be opened as a csv (comma seperated value)
2) otherwise, use --> the file complete path such as open("User/Desktop/myfile.csv")
in both cases use --> with open(.....) as f:
for x in f:
write some code here..
and in this case x represents an element or cell in your excel file