tags:

views:

446

answers:

2

How do you extract the data using regex in a workbook. For example, I want to extract a set of strings that match a pattern in the workbook which contains many sheets.

+4  A: 

Install the Spreadsheet::ParseExcel module and,
Look at question converting an Excel (xls) file to a comma separated (csv) file without the GUI.
From there you can use grep on the generated CSV data.

nik
You don't have to do the conversion to CSV; assuming Perl is what you intend to process in, then the first part of this is all you need to know. That said, the question referenced will have decent example code in.
ijw
I guess, I should not have written the last line about using the CSV output for this answer. While that can be done it would be a round-about way. And, I `was` referring to the perl script as an example.
nik
+1  A: 

There is a Perl utilty called XLS Tools that allows you to grep an Excel file using Perl command-line idioms. For example:

XLSperl -nle '/pattern/ and print' file.xls
jmcnamara