in reply to HTML Parser strange Null Character in data
Have a look at the docs on Regular Expression Character Classes. For example, if the problem character is a control character then you can use the [:cntrl:] character class to remove it.
foreach my $row ($ts->rows) { @$row = map { clean_text( $_ ) } @$row; #... } #... my $cell1=$te->rows->[$rowIndex][1]; clean_text( $cell1 ); #... sub clean_text { # remove all control characters $_[0] =~ s/[[:cntrl:]]+//g; # remove white space at start/end $_[0] =~ s/^\s+//; $_[0] =~ s/\s+$//; # or remove all white space $_[0] =~ s/\s+//g; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HTML Parser strange Null Character in data
by caind (Initiate) on Mar 30, 2015 at 18:29 UTC |