Excel on the command line

2 views
Skip to first unread message

Gary Funck

unread,
Aug 16, 2009, 6:22:20 PM8/16/09
to WriteExcel
While Googling for the answer to a S::WE question,
I ran into this tool:

http://perl.jonallen.info/projects/xlsperl

Xlsperl is basically a wrapper around S::PE and
can do some interesting things like grep-ing
through the cells/rows of an Excel spreadsheet.

For example,
XLSperl -nale '/pattern/ and print "$ARGV:$WS:$CELL $_"' *.xls
greps for a pattern in the Excel files given by '*.xls'
and prints 'file:worksheet:<cell-coords> <value>'
for each matching cell.

A companion function, XLSprint, can be used
to *print* to Excel files. Here's an example,

XLSperl -F: -nale 'next if /^#/; XLSprint @F' /etc/passwd >pw.xls
reads the /etc/password file and writes its contents
into the Excel file pw.xls.

The author has a slide presentation describing the xlsperl tool.

"Excel on the command line":
http://perl.jonallen.info/talks/excelcommandline

I haven't used the package, but certainly would have used
the grep capability at various times in the past, if I'd known
about it.

Reply all
Reply to author
Forward
0 new messages