Change this sub to shift right existing entries and add comment
# update sheet sub update_sheet { my ($kw,$value,$comment) = @_; my ($sht,$r,$c) = @{$kwhashref->{$kw}}[0..2]; my $sel = $Book->Worksheets($sht)->Cells($r,$c+1); $sel->Insert({ Shift => -4161}); # xlToRight $sel->{Value} = $value; $sel->AddComment( { Text=> $comment } ); $kwhashref->{$kw}[3] = $value; # for debugging }
Add the extra comment parameter into the update_sheet call in 2 places here
if (/($re).*addr = ([.\d]+)/){ print "LIne $line_no kw=[$1] value=[$2] special\n"; update_sheet($1,$2,$_); next; } # match more than 1 per line e.g. usim and isim while (/($re)[ =]*([.\d]+)/g){ print "Line $line_no kw=[$1] value=[$2]\n"; update_sheet($1,$2,$_); }
As written it stores the whole line in the comment. I'll leave it to you to filter it as required
pojIn reply to Re^12: How to read the value of a variable (read from a Excel file converted Into text file) and put then back into Excel column
by poj
in thread How to read the value of a variable (read from a Excel file converted Into text file) and put then back into Excel column
by rockyurock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |