Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Parseexcel retrieve strange chars

Reply
Thread Tools

Parseexcel retrieve strange chars

 
 
Luiz
Guest
Posts: n/a
 
      12-27-2006
Hi,

I am a Ruby newbie, and I am trying to use parseexcel library to
retrieve some information from a spreadsheet, but when I try this, I
receive the chars contained on the cell alternated square chars. Does
anybody knows how to solve this?

Thanks,

Luiz

 
Reply With Quote
 
 
 
 
Luiz
Guest
Posts: n/a
 
      12-27-2006
I print the square code char and it is zero (nil). Please, somebody
help me.

workbook = Spreadsheet:arseExcel.parse('myspreadsheet.xls')

# usually, you want the first worksheet:
worksheet = workbook.worksheet(0)

# now you can either iterate over all rows, skipping the first
number of
# rows (in case you know they just contain column headers)
myVal = worksheet.cell(0,4).value
puts myVal

Luiz wrote:
> Hi,
>
> I am a Ruby newbie, and I am trying to use parseexcel library to
> retrieve some information from a spreadsheet, but when I try this, I
> receive the chars contained on the cell alternated square chars. Does
> anybody knows how to solve this?
>
> Thanks,
>
> Luiz


 
Reply With Quote
 
 
 
 
Chris Shea
Guest
Posts: n/a
 
      12-27-2006

Luiz wrote:
> I print the square code char and it is zero (nil). Please, somebody
> help me.
>
> workbook = Spreadsheet:arseExcel.parse('myspreadsheet.xls')
>
> # usually, you want the first worksheet:
> worksheet = workbook.worksheet(0)
>
> # now you can either iterate over all rows, skipping the first
> number of
> # rows (in case you know they just contain column headers)
> myVal = worksheet.cell(0,4).value
> puts myVal
>


If you're sure they're all null characters, you can always use gsub to
get rid of them:

myVal.gsub!(/\000/,'')


Chris Shea

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to truncate char string fromt beginning and replace chars instring by other chars in C or C++? Hongyu C++ 9 08-08-2008 12:18 PM
Strange Error with parseexcel and classifier... appleman@gmail.com Ruby 2 11-25-2006 08:59 PM
Floats to chars and chars to floats Kosio C Programming 44 09-23-2005 09:49 AM
receiving ??? chars instead of "special" chars M.Posseth ASP .Net Web Services 3 11-16-2004 07:00 PM
problems with parseexcel module Nigel Wilkinson Ruby 0 12-02-2003 10:45 PM



Advertisments