On Tue, May 5, 2009 at 14:22, Vicky Goyal <[email protected]>
wrote:
> Now i jus need to put
>
> M   Abdul Hakkim M.   75779   abdulhakkim_m   IHLD   MYSORE2STP
> M   Abhilash A. M.      70239    Abilash_293891  PRH2  PROGBLR15
>
> in excel sheet.

This will create file b.csv. Let me know if you would like me to comment the
code.

---

b.csv

"",M,Abdul Hakkim M.,75779,abdulhakkim_m,IHLD,MYSORE2STP
"",M,Abhilash A. M.,70239,Abilash_293891,PRH2,PROGBLR15
"",M,Abhilash B. S.,58330,abhilash_bs,FNAT,INFCITYPRK4
"",M,Abhishek Anand Caleb T.,82077,abhishek_caleb,CMEX,INFCITYPRK2
"",M,Abhishek Bhatnagar,"",Abhishek_Bhatnagar01,PRCS,PROGPUN01
"",M,Abhishek Gupta,51246,Abhishek_Gupta17,SI,HYD2STP

---

b.rb

require "watir"
require "csv"

b = Watir::IE.attach(:url, //) # I have the page already opened in browser

b.table(:index, 1).rows.each do |row|
  text = row.cells.collect do |cell|
    cell.text
  end
  File.open("b.csv", "a") do |file|
    CSV::Writer.generate(file) do |csv|
      csv << text
    end
  end
end

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to