parseexcel

L

Li Chen

Hi all,

I can use parseexcel to open excel file and process the data within
excel. 1)But I am not sure how to write the processed data back to excel
using parseexcel. What is the syntax for this? 2) How to select a range
of cells, for example, row1,column 1 to row 3,column 10 instead of
whole columns or whole rows.

Thank you in advance,


Li
 
H

Hannes Wyss

Hi Li

1)But I am not sure how to write the processed data back to excel
using parseexcel. What is the syntax for this?
ParseExcel does not write Excel files. For that you will have to use
the SpreadSheet::Excel library developed by Daniel Berger. I plan to
merge the two libraries in the future, but that will have to wait
until late 2007.

Both libraries are available here, or via gem install:
http://rubyforge.org/frs/?group_id=678
2) How to select a range
of cells, for example, row1,column 1 to row 3,column 10 instead of
whole columns or whole rows.
There are no methods that do directly what you want - you'll have to
do something like:
1.upto(3) do |row|
1.upto(10) do |col|
puts worksheet.cell(row, col)
end
end

hth

Hannes
 
L

Li Chen

Hannes said:
There are no methods that do directly what you want - you'll have to
do something like:
1.upto(3) do |row|
1.upto(10) do |col|
puts worksheet.cell(row, col)
end
end


Thanks. I'll give them a try tonight to see if they work.

Li
 
L

Li Chen

Hi Hannes,

Do you know what the advantages of using parseexcel are , compared to
export data from excel into text file, parse them,then import them back
into excel using spreadsheetexcel?


Thanks,

Li
 
H

Hannes Wyss

Li

Do you know what the advantages of using parseexcel are , compared to
export data from excel into text file, parse them,then import them back
into excel using spreadsheetexcel?

I probably would not call them advantages, but circumstances:
- if you cannot choose your input format, and thus would have to
perform that export to text (csv?) manually, use parseexcel.
- parseexcel can give you information on the data contained in a cell
(Cell#type returns :date, :numeric or :text) - if you need that
information, use parseexcel.

hth

Hannes
 
A

Andy PS

Hannes said:
Li



I probably would not call them advantages, but circumstances:
- if you cannot choose your input format, and thus would have to
perform that export to text (csv?) manually, use parseexcel.
- parseexcel can give you information on the data contained in a cell
(Cell#type returns :date, :numeric or :text) - if you need that
information, use parseexcel.

hth

Hannes

Can anyone Help me, how do I use excel file for data driven
testing in Selenium Remote Control. Basically My problem is, we have
100 records,how can i fetch Username & password field to execute my
application with every User
 
M

mully

Can anyone Help me, how do I use excel file for data driven
testing in Selenium Remote Control. Basically My problem is, we have
100 records,how can i fetch Username & password field to execute my
application with every User

Andy-

I know nothing about Selenium. If, however, you are on a Windows
machine with Excel installed, you could use win32ole to automate
Excel. If you think that has potential, you'll find more info here:

http://rubyonwindows.blogspot.com/search/label/excel

David
http://rubyonwindows.blogspot.com
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top