Output CSV file should be:– &dash
I converted the xls file into xml. Than i used the below code to do the task:'ߝ' => '‐'
I think the above code is not efficient. Can anyone suggest me efficient one to do that. Thanks all monks for your suggestion.use strict; use warnings; use XML::Twig; #open(FH, "conv.xml"); my $file="C:/conv.xml"; my $tmp; $tmp = XML::Twig->new(); $tmp->parsefile($file); my $root = $tmp->root; my $hex_value; my $entity_value; my $real_value; #while (<FH>){ open(FH, ">records.txt"); foreach my $record ($root->children('record')){ if ($record->first_child_text('hex_value') eq '') { $hex_value=''; }else{ $hex_value = $record->first_child_text('hex_value'); $hex_value=~s/^\s*//g; } if ($record->first_child_text('entity_value') eq '') { $entity_value=''; }else{ $entity_value = $record->first_child_text('entity_value'); $entity_value=~s/\s*$//g; } if ($record->first_child_text('real_value') eq '') { $real_value=$entity_value.";"; } #print "$real_value\n"; #print FH "Hexadecimal Value \t Entity Value \t Real_value"; print FH "\'$real_value\' => \'$hex_value\' +,\n"; }
In reply to Efficient solution needed for this program by valavanp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |