On 18-Dec-2002/00:45 -0500, Medhat Galal <[EMAIL PROTECTED]> wrote:
>I was trying to find a way to import my contacts from outlook XP to
>Evolution 1.2. Any tips on that?

Export the Contacts to CSV, then convert the CSV to LDAP Data Interchange
Format (LDIF). Evolution can import multiple contacts from an LDIF file in
a single pass. This is a lot faster and easier than importing VCF files
one at a time. I wrote a short perl script to handle this.


#!/usr/bin/perl
#
# This is an example of using the Text::ParseWords module to convert
# a comma-delimited file to LDIF. Requires Perl 5.005 or higher. Just
# pipe the CSV file to this script and redirect the output to a file:
#
#     cat FILENAME.csv | csv2ldif.pl > FILENAME.ldif
#
# Copyright (c) 2001, Anthony E. Greene <mailto:[EMAIL PROTECTED]>
# License: GNU GPL, v2 or later <http://www.gnu.org/licenses/gpl.txt>
#

# Load the required module.
use Text::ParseWords;

# Set a default objectclass and suffix.
$objectlass = 'person';
$suffix = 'dc=my organization, dc=com';

# Read lines from STDIN.
while ($line = <STDIN>) {
  @fields = &quotewords(',',0,$line);

  # Set variable values based on the array values.
  # Edit these to match the format of your CSV file.
  $cn    = $fields[0];
  $fname = $fields[1];
  $lname = $fields[2];
  $title = $fields[3];
  $o     = $fields[4];
  $ou    = $fields[5];
  $mail  = $fields[6];
  $phone = $fields[7];
  $fax   = $fields[8];

  # Output the values.
  print "dn: cn=$cn, $suffix\n";
  print "cn: $cn\n";
  print "givenname: $fname\n";
  print "sn: $lname\n";
  print "title: $title\n";
  print "o: $o\n";
  print "ou: $ou\n";
  print "mail: $mail\n";
  print "telephonenumber: $phone\n";
  print "facsimileteletelephonenumber: $fax\n";
  print "objectclass: $objectclass\n";
  print "\n";
}

exit;



-- 
Anthony E. Greene <mailto:[EMAIL PROTECTED]%3E>
OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
AOL/Yahoo Messenger: TonyG05    HomePage: <http://www.pobox.com/~agreene/>
Linux. The choice of a GNU generation <http://www.linux.org/>



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to