Referring to the Parsing of Pim.vol file issue.

I was able to run the perl script, but notice numerous Argument "wait"  isn't numeric in numeric gt <>> at contact.pl line 16. Now  pim.vol contains contacts, calendar, etc, so maybe the contacts are th issue. just inquiring if anybody ran into this. Also how do you save the output to a file.
die "Usage: parse_Contact.pl pim.vol" unless $ARGV[0];
 
print "Start parsing..\n";
 
my $cond = "wait";
my $contact = '';
my %contacts;
 
open(F, "<".$ARGV[0] );
 
my $s;
while(read(F, $s, 1) ) {
 
  while($s =~ /./g) {
    if( ord($s) == 8 && $cond eq "wait" ) {
      $cond = "zero";
    } elsif ( ord($s) == 0 && $cond eq "zero" ) {
      $cond = "start";
    } elsif ( $cond eq "zero" ) {
      $cond = "wait";
    } elsif ( ( $cond =~ /^start|read$/ || ( $cond > 0 && $cond < 6 )) && ( ( ord($s) >= 48 && ord($s) <= 57 ) || ( ord($s) >= 97 && ord($s) <= 122 ) || ( ord($s) >= 65 && ord($s) <= 90 ) || ord($s) == 32 ) ) {
      $contact =~ /(.)$/;
      if( ( ord($1) < 48 || ord($1) > 57 ) && ( ord($s) >= 48 && ord($s) <= 57 ) ) {
        $contact .= ';';
      }
      $contact .= $s;
      $cond = "read";
    } elsif ( $cond eq 'read' ) {
      $cond = 1;
    } elsif ( $cond >= 4 ) {
      $cond = "wait";
      $contacts{$contact} = 1 if $contact =~ /\d{5,}/ && $contact =~ /\w+/;
      $contact = '';
    } elsif ( $cond > 0) {
      $cond++;
    }
  }
}
 
close(F);
 
for my $contact (sort keys %contacts) {
  print $contact."\n";
  
}

Open in new window

Med123Asked:
Who is Participating?
 
Adam314Connect With a Mentor Commented:
Line 16 in what you posted does not look to be where the error is coming from.  Post the entire script.

To save to a file, add this to the end of your command:   > file.txt
eg: parse_Contact.pl pim.vol > file.txt
0
 
ozoConnect With a Mentor Commented:
perl -Mdiagnostics  -we '$cond = "wait"; if( $cond > 0 ){}'
Argument "wait" isn't numeric in numeric gt (>) at -e line 1 (#1)
    (W numeric) The indicated string was fed as an argument to an operator
    that expected a numeric value instead.  If you're fortunate the message
    will identify which operator was so unfortunate.


what are you trying to do?
did you mean to use a string compare gt instead of a numeric compare >
0
 
Med123Author Commented:
I was just trying extract the contact information out of the PIM.VOL. My wife's cell phone kind of crash and it won't let her access the contacts or Calendar. I care more about the contacts because she has been adding new ones for a few months now and we couldn't get the phone to sync with her PC. So I was able to beam the PIM.Vol file to my PC. I took this PERL script from another users on the Exhange who was experiencing the same issue. I just modified the parse_ to my file name Contact.  Also did anybody ever figure out a way to better format the data that gets extracted. Also that snipplet of code was the whole script. I think the post was closed, but I was just wondering.
Contact.txt
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Adam314Connect With a Mentor Commented:
I'm guessing this is because either your pim.vol file is different from the format the script was designed for, or this is a bug in the script.

0
 
Med123Author Commented:
You're probably right. Hey did anybody have any Code Snippet I could use beside this one for extracting data from the Pim.vol file? or even another suggestion on how to browse/read a pim.vol file?  I'm running out of ideas.
0
 
Adam314Connect With a Mentor Commented:
Depending on how dead the phone is, and what model, you might be able to use BitPim to get the data:
    http://www.bitpim.org/
0
 
Med123Author Commented:
It's an AllTell  HTC Touch phone. any Ideas on that one?  Thanks for the other tip.
0
 
Adam314Connect With a Mentor Commented:
You could try going to an AllTell retailer, and see if they have any equipment/software that will help.  Or contact  AllTell and/or HTC customer service, and see if they have any suggestions.

I don't know of anything that works with that phone though.
0
 
ozoConnect With a Mentor Commented:
if you don't mind treating "wait" as 0 in numeric comparisons, and you are not worried about catching other problems in the script, you might just turn off warnings by setting
no warnings;
0
 
ozoConnect With a Mentor Commented:
#or
no warnings "numeric";
#you can also turn them off just in the block in which you do the compare
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.