Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8212055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:38:14+00:00 2026-06-07T10:38:14+00:00

Hi I am trying to compare a cell value in the spreadhseet with a

  • 0

Hi I am trying to compare a cell value in the spreadhseet with a string as given below.

workbook = Spreadsheet::ParseExcel.parse(name)

#Get the first worksheet
worksheet = workbook.worksheet(0)
puts worksheet.cell(4,0).to_s 
puts "SecurityKey".to_s
puts "SecurityKey".to_s.eql? worksheet.cell(4,0).to_s

I tried == , .eq? and all other possible string comparison techniques but it always results as false even when the two strings are the same. Can u help me out??

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:38:15+00:00Added an answer on June 7, 2026 at 10:38 am

    A cell object has numerous child objects and methods. The Value
    (read/write) method returns a Cell’s value as it is stored internally.
    A cell’s Text (read-only) method returns the value as it is currently
    displayed. For example, if cell has the value "1234.56789" formatted
    as Currency, the Value and Text methods return different values

    http://rubyonwindows.blogspot.com/2007/04/automating-excel-with-ruby-rows-columns.html

    Try using value or text

    worksheet.Cells(4, 0).Value == "SecurityKey"
    worksheet.Cells(4, 0).Text == "SecurityKey"
    

    Edit

    Avoid using parseexcel. Try something like

    require 'spreadsheet'
    
    Spreadsheet.client_encoding = 'UTF-8'
    workbook = Spreadsheet.open '/path/to/file.xls'
    first_sheet = workbook.worksheet 0 # or name
    cell = first_sheet.row(1).at(4)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to compare a string given in an input to a div's content
I am trying to compare a date against the first of next month from
I am trying to compare a string from getline(file,line) with a std::string s=mmee :
I am trying to compare the dates with time from inside a cell with
Im trying to compare two different string encoded by sha512. But, result is different.
I'm trying to compare a character string with the argv argument. I have this
Trying to compare a given Time between two times to see if it's within
When trying to compare two objects passed as arguments: first as object, second as
Currently I am trying to compare two variables, newhtml and oldhtml . I get
I'm basicly trying to compare a token(string) with a hex-datatype! Example: #include<stdio.h> #include<string.h> int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.