#!/usr/bin/perl
# decoupage de l'annuaire de Massy
# $Id: csv2ldif.pl,v 1.2 2003/07/18 13:45:10 herbelot Exp $

# fichier en entree : 
# quatre colonnes :
# nom de service ; RFC lies ; module Perl ; commentaire
#use Unicode::Lite;

while (<>) {
  chomp();
  #convert 'latin1', 'utf8', $_;
  ($nom,$prenom,$phone1,$phone2) = split /;/;
  #print "init line", $_, "\n";
  #print "split line", $nom,"\nprenom",$prenom,"\n";

  print "version: 1\n";
  print "dn:cn=",$prenom," ",$nom;
  print ",ou=People";
  print ",dc=sfim,dc=fr\n";
  print "objectclass:top\nobjectclass:person\n";
  print "cn:$prenom $nom\n";
  print "sn:$nom\n";
  print "telephonenumber:$phone1\n\n";
};
