Hi gurus,

Script:

#!/usr/bin/python

import xlrd, sys

def main(toParse):

    workBook = xlrd.open_workbook(toParse)
    mySheet = workBook.sheet_by_index(0)

    for rownum in range(mySheet.nrows):
        print mySheet.row_values(rownum)

if __name__ == '__main__':
    if len(sys.argv) < 2:
        sys.stderr.write("Usage: %s EXCEL.XLS\n" % (sys.argv[0]))
    else:
        main(sys.argv[1])

Output:

myu...@testsvr:~> ./parse.py test.xls
*[u'*thisislineone*'*, 343*.0]*
*[u'*thisislinetwo*'*, 344*.0]*
*[u'*thisislinethree*'*, 345*.0]*


This is the content of my test.xls:

thisislineone       343
thisislinetwo       344
thisislinethree     345


How do i remove the bold part of the output (*[u'*. *'* and *.0]* and store
the output in a 2 dimensional array?

Many thanks.


PythonNewbie,


Jay
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to