Searching within XLS files - is it good approach ?

T

Telemach

I'm newbie in Perl but don't give up so easily. My question is : Is it
possible to achieve my goals browsing just a xls file ? I know it's
good to convert to some better format but I would be happy if that
step is not necessary.

I have big Excel file which has over 20 worksheets.
What I need is to search for $value1 within the whole spreadsheet and
if found to search for $value2 within a worksheet where $value1 was
found. I know that cells have multi line input like :

ABCaaa
CDEbbb
EFGccc
etc.

so if $value2 = "CDE" I need Perl to get only CDEbbb and put under
$result1

next I want to read the col/row number of search result for $value2
and check the cell on two colums right from this one and copy the
content to $result2, if cell is blank I need to check
every single one above until cell with content is found

I'd appreciate any help about what module and commands shall be used
or where can I find an examples or a tutorial about searching withing
XLS files.

Kind regards,

- Telemach -
 
J

Joost Diepenmaat

Telemach said:
I'm newbie in Perl but don't give up so easily. My question is : Is it
possible to achieve my goals browsing just a xls file ? I know it's
good to convert to some better format but I would be happy if that
step is not necessary.

I've only used SpreadSheet::WriteExcel, which as the name implies,
doesn't read excel files, but the documentation for that module points
to a lot modules that do. See:

<http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.20/lib/
Spreadsheet/WriteExcel.pm#READING_EXCEL_FILES>

As far as I can tell, most of those will only work on Windows.

Even more can probably be found if you search for "excel" on
<http://search.cpan.org/>
 
T

Telemach

As far as I can tell, most of those will only work on Windows.

I need to get this working under linux

Even more can probably be found if you search for "excel" on
<http://search.cpan.org/>

I found some but still can't get a decent documentation how to search
and not only read.

- Telemach -
 
X

xhoster

Telemach said:
I need to get this working under linux

Then Spreadsheet::parseExcel is the only one I know of.
I found some but still can't get a decent documentation how to search
and not only read.

If you aren't using Windows, Excel can't do the searching for you. Do it
in Perl.

Read, test, read, test, read, test.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 
T

Telemach

Read, test, read, test, read, test.

From what I understand there is no sub for searching and dedicated
loop will be needed.

- Telemach -
 
T

Tad J McClellan

Telemach said:
From what I understand there is no sub for searching and dedicated
loop will be needed.


That's correct.

Now that you know what is needed, all that's left is to write
code that does what is needed.
 
S

S P Arif Sahari Wibowo

Do you suggest making a foreach loop that will go thru all of
worksheets matching $variable with every single cell Val ?

Why not? An excel spreadsheet basically is a 3D array, how else
you find a value in a 3D array? That's not difficult to code,
right?
I'm asking because there is no direct sub or command to make a
search

Might as well, since giving the particular function won't give
much advantage anyway.

--
(stephan paul) Arif Sahari Wibowo
_____ _____ _____ _____
/____ /____/ /____/ /____
_____/ / / / _____/ http://www.arifsaha.com/

Xinnian Kuaile! $B?7G/2w\[(J Gongxi Facai $B634nb$:b(J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top