[Info-vax] PERL for OpenVMS Alpha that will install on V8.4

Jan-Erik Soderholm jan-erik.soderholm at telia.com
Mon Dec 2 04:20:01 EST 2013


Stephen Hoffman wrote 2013-12-02 03:50:
> On 2013-12-02 02:00:33 +0000,   VAXman-  @SendSpamHere.ORG said:
>
>> Well, this <https://github.com/dilshod/xlsx2csv/blob/master/xlsx2csv.py>
>> in Python turned out to be less than 40 lines in Perl, replete with being
>> able to parse *BOTH* .XLS and .XLSX into .CSV!!!
>
> FWIW: <http://stackoverflow.com/questions/9884353/xls-to-csv-convertor>
>
>

The 10 line example on Hoffs link runs out-of-the-box with the Python
port for OpenVMS. Both the xlrd and the csv modules are pre-built into
the port. Just a downdload of two files from  http://www.vmspython.org/
and a few LD and MOUNT commands to mount the two container files.

The current xlrd in the port (0.9.1, not 0.7.1 as the web page says)
supports .xlsx (from 0.8.0 according to Hoffs link above).

But to actualy compare, the source for the 40 line Perl script would
be nice to have. This is the Python code b.t.w (from Hoffs link):

----------------------------------------------------------
  import xlrd
  import csv

  def csv_from_excel():

     wb = xlrd.open_workbook('your_workbook.xls')
     sh = wb.sheet_by_name('Sheet1')
     your_csv_file = open('your_csv_file.csv', 'wb')
     wr = csv.writer(your_csv_file, quoting=csv.QUOTE_ALL)

     for rownum in xrange(sh.nrows):
         wr.writerow(sh.row_values(rownum))

     your_csv_file.close()
----------------------------------------------------------





More information about the Info-vax mailing list