For white spaces you need to trim the value. Chomp will remove new line character from the end of the string.
Hi,
I'd really appreciate some help.
I am using Spreadsheet::ParseExcel to search an excel spreadsheet for a specific entry (specified by the user).
I've created a hash with the data collected from the excel spreadsheet the key of which (an array) I use it to compare with the users entry and hey presto deliver the info required.
The problem I have is that the excel spreadsheet has white space mainly carriage returns which I need to chomp but I've tried several ways of doing this and none of them work!
Here's the part of the code which I'm trying to chomp
if ($col == 0 || $col == 4 || $col == 9) {
#Collect hash key and assign to @key array
if ($col == 0) {
$key[$row] = $worksheet->get_cell($row, $col);
}
I've tried
chomp ($key[$row] = $worksheet->get_cell($row, $col));
chomp ($key[$row] = $key[$row]->{_Value});
chomp (@key);
chomp $key[$row]->{_Value};
chomp ($key[$row]);
I can't understand why I can print $key[$row]->{_Value}; but chomp $key[$row]->{_Value}; is ineffective.
I've basically tried every combination of chomp I can think of but the white spaces are still there!!!!
Thanks in advance for looking into this one.
Tanscia.
--
--
You received this message because you are subscribed to the Spreadsheet::ParseExcel Google Group.
For posting and other options visit this group at:
http://groups.google.com/group/spreadsheet-parseexcel?hl=en
You can also post by sending an email to:
http://groups.google.com/group/spreadsheet-parseexcel?hl=en