Reviews by Ravikumar Kattekola

cpanratings
 

RSS

excel2txt (0.04) ****

Hi there..as John said.. this is an excellent program that uses Spreadsheet::Parseexcel and it made my project work so easy.. but when you convert the same excel file second or third time it gives some odd names to the newly created files like :

C:\temp>perl excel2txt.pl test.xls
Processing test.xls
Writing 'C:\temp\test-people.txt'
Writing 'C:\temp\test-salaries.txt'
Done, processed 1 Excel file, created 2 data files.

C:\temp>perl excel2txt.pl test.xls
Processing test.xls
Writing 'C:\temp\test-people.txt-1.txt'
Writing 'C:\temp\test-salaries.txt-1.txt'
Done, processed 1 Excel file, created 2 data files.

C:\temp>perl excel2txt.pl test.xls
Processing test.xls
Writing 'C:\temp\test-people.txt-2.txt'
Writing 'C:\temp\test-salaries.txt-2.txt'
Done, processed 1 Excel file, created 2 data files.

like workbook-ws.txt-x.txt (x being no.)and so..

this can be changed to workbook-ws-x.txt by changing the line

( my $base = $out_file ) =~ /${suffix}$/; at line no.133
to

my $base =catfile($out_dir,$out_name);

outpu after changing the line:

C:\temp>perl excel2txt.pl test.xls
Processing test.xls
Writing 'C:\temp\test-people.txt'
Writing 'C:\temp\test-salaries.txt'
Done, processed 1 Excel file, created 2 data files.

C:\temp>perl excel2txt.pl test.xls
Processing test.xls
Writing 'C:\temp\test-people-1.txt'
Writing 'C:\temp\test-salaries-1.txt'
Done, processed 1 Excel file, created 2 data files.

C:\temp>perl excel2txt.pl test.xls
Processing test.xls
Writing 'C:\temp\test-people-2.txt'
Writing 'C:\temp\test-salaries-2.txt'
Done, processed 1 Excel file, created 2 data files.

P.S.(this won't change the way it works or efficiency but makes output file name readable)
Regards,
thehelios..

Ravikumar Kattekola - 2009-07-29T23:26:08 (permalink)

1 out of 2 found this review helpful. Was this review helpful to you?  Yes No