How to run perl script on PC, please.....

A

-=[ apocalypso ]=-

Hi Guys,

I nave no expirienc with it at all, but I find interesting info which may
help to my members...

Here it is...

Nokia-File-NFB version 0.01
====================================

This module provides methods to modify or create the backup files used
by the Nokia PC Suite - Backup And Restore program.

It can be used to extract or add new elements to the file.

These elements contain items such as the Phone Book, Calendar, Radio
Settings,
Pictures, Photos, etc.


INSTALLATION

To install this module type the following:

perl Makefile.PL
make
make test
make install

DEPENDENCIES

This module requires these other modules and libraries:
Compress::Zlib

AUTHOR
Robert Price

COPYRIGHT AND LICENCE
Copyright (C) 2004 by Robert Price

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,
at your option, any later version of Perl 5 you may have available.
Code:
http://www.cpan.org/modules/by-module/Nokia/



=======================================================
=======================================================
=======================================================
=======================================================


Contacts and messages application saves the details into a Microsoft Access
compatible database called Contacts2.mdb. Once I had discovered this all I
had to do was import the database into Access and save it as XML. I then
wrote the following Perl script to extract the name, number and email
information from the XML file and generate vCards for each contact. The
generated vCards are then just dropped into the phones contacts folder when
it is connected to the computer with the DKU-2 USB cable or with Bluetooth.


#!/usr/bin/perl -w

## Perl script to take a Nokia contacts database saved from the Nokia PC
Suite,
## that has been converted to XML with MS Access, and then turn the
contents
## into individual vCards suitable for importing into a Nokia 7610 phone.
##
## Robert Price - 02/07/2004
## http://www.robertprice.co.uk

use strict;
use XML::LibXML;

## create a new XML parser object.
my $parser = XML::LibXML->new();

## parse the contacts file.
my $document = $parser->parse_file('Contacts2.xml');

## find each Contacts2 node.
foreach my $contacts2_node ($document->findnodes("//Contacts2")) {

## extact the name, number and email from the contacts2 node.
my $name = $contacts2_node->findvalue('./Name/text()');
my $number = $contacts2_node->findvalue('./Number1/text()');
my $email = $contacts2_node->findvalue('./Text1/text()');

## write the data to a vCard with the same filename as the contacts
name.
open(CONTACT, ">contacts/$name.vcf");
print CONTACT "BEGIN:VCARD\r\n";
print CONTACT "VERSION:2.1\r\n";
## we should make REV dynamic with a current timestamp,
## but as we're only running it once we won't bother.
print CONTACT "REV:20040802T093000Z\r\n";
print CONTACT "N:;$name;;;\r\n";
print CONTACT "TEL;CELL:$number\r\n" if ($number);
print CONTACT "EMAIL:$email\r\n" if ($email);
print CONTACT "FN:$name\r\n";
print CONTACT "END:VCARD\r\n";
close(CONTACT);
}


=============================
######### portfolio #########
=============================
www.symbian-freak.com
=============================
Symbian Freak introduces various researches for symbian users like:

- Latest news, Error Fixes, Modding, Guides, Tutorials ,Ask guru form,
and offcourse a detailed forum with professional support for every single user.
To get more out of your favourite device, visit the website.

=============================
Don't take life too seriously
you're not going to survive it,
anyway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top