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

David Froble davef at tsoft-inc.com
Tue Dec 3 00:33:56 EST 2013


VAXman- @SendSpamHere.ORG wrote:
> In article <l7hjc2$759$1 at news.albasani.net>, Jan-Erik Soderholm <jan-erik.soderholm at telia.com> writes:
>> 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()
>> ----------------------------------------------------------
> 
> Quote all?  I'll assume that means that all of the CSVs are quoted?
> 
> What about monetary values?  This particular customer is taking in
> data from international customers with different currency cirteria.
> 

As usual, one size really doesn't fit all ....



More information about the Info-vax mailing list