Post thumbnail of Convert Excel spreadsheets to CSV in Linux without OpenOffice
25 September 2009
Continue reading Convert Excel spreadsheets to CSV in Linux without OpenOffice

Convert Excel spreadsheets to CSV in Linux without OpenOffice

I needed a batch converter to turn non-xml style Excel spreadsheets (all the older versions) into delimited text files. If you run it without supplying a sheet name, it will list all the sheets available. You can also optionally define a delimiter to use instead of the default comma. So here’s my code along with part of the xlrd module which I tweaked a little.

Post thumbnail of Perl Spreadsheet::ParseExcel to convert Excel Spreadsheets
14 September 2009
Continue reading Perl Spreadsheet::ParseExcel to convert Excel Spreadsheets

Perl Spreadsheet::ParseExcel to convert Excel Spreadsheets

#!/usr/bin/perl -w
# For each tab (worksheet) in a file (workbook),
# spit out columns separated by “,”,
# and rows separated by c/r.
use Spreadsheet::ParseExcel;
use strict;
my $filename = shift || “Book1.xls”;
my $e = new Spreadsheet::ParseExcel;
my $eBook = $e->Parse($filename);
my $sheets = $eBook->{SheetCount};
my ($eSheet, $sheetName);
foreach my $sheet (0 .. $sheets - 1) {

Powered by Wordpress   |   Lunated designed by ZenVerse