Le mar 08/11/2005 à 14:38, Gérard Henry a écrit : > bonjour, > je dois recuperer un carnet d'adresses au format vCard (vcf en > provenance de Apple Mail), au format ldif. Le Vcard c'est du texte un peu comme LDIF non ? J'ai écrit un bout de code qui convertissait les rendez vous Vcalendar en XAPIA/CDE et cela ne m'avait pas paru très difficile. Vcard et Vcalendar sont des normes jumelles.
> En cherchant sur google, je vois que evolution sait importer du vcard, > mais sans succes sur ma machine. Y en a t il parmi vous qui ont deja > essaye? Je ne vois pas en quoi cela résout le problème d'importer dans Evolution sauf si Evolution travaille nativement en LDIF. Voila le code qui faisait cela. Il peut servir d'ossature pour la conversion. #!/usr/dt/bin/dtksh # # Convertisseur de calendrier vCalendar (iCal) vers XAPIA-CSA CDE # # [EMAIL PROTECTED] 31/3/2000 # if (( $# == 0 )) then unit=0 else # Correction du bug Netscape qui ne met pas le \n final #exec 3>> $1 #print -u3 #exec 3>&- if [[ -f $1 ]] then exec 3< $1 unit=3 fi fi while IFS=":" read -u$unit LABEL VALUE do case $LABEL in 'BEGIN') if [[ $VALUE == VCALENDAR ]] then print "\n\n\t** Calendar Appointment **" print -- "-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Entry Delimiter//EN:string:begin" print -- "-//XAPIA/CSA/ENTRYATTR//NONSGML Type//EN:uinteger:0" fi if [[ $VALUE == VEVENT ]] then print -- "-//XAPIA/CSA/ENTRYATTR//NONSGML Subtype//EN:string:-//XAPIA/CSA/SUBTYPE//NONSGML Subtype Appointment//EN" fi ;; 'DTSTART') print -- "-//XAPIA/CSA/ENTRYATTR//NONSGML Start Date//EN:datetime:$VALUE" START="$VALUE" #print -- "-//XAPIA/CSA/ENTRYATTR//NONSGML Type//EN:uinteger:0" # détermine la visibilité 0, 1, 2 #print -- "-//XAPIA/CSA/ENTRYATTR//NONSGML Classification//EN:uinteger:0" ;; 'DTEND') print -- "-//XAPIA/CSA/ENTRYATTR//NONSGML End Date//EN:datetime:$VALUE" END="$VALUE" ;; 'SUMMARY') print -- "-//XAPIA/CSA/ENTRYATTR//NONSGML Summary//EN:string:$VALUE\n$LOCATION\n$DESCRIPTION" SUMMARY="$VALUE" ;; 'END') if [[ $VALUE == VEVENT ]] then : fi if [[ $VALUE == VCALENDAR ]] then print -- "-//CDE_XAPIA_PRIVATE/CSA/ENTRYATTR//NONSGML Entry Delimiter//EN:string:end" print "\tDate: ${START:4:2}/${START:6:2}/${START:0:4} " (( HH = ${START:9:2} + 2 )) MM=${START:11:2} print "\tStart: $HH$MM" (( HH = ${END:9:2} + 2 )) MM=${END:11:2} print "\tEnd: $HH$MM " print "\tWhat: $SUMMARY\n\t$LOCATION\n\t$DESCRIPTION" print "\t\c" fi ;; 'PRODID') : ;; 'DTSTAMP') : ;; 'METHOD') : ;; 'VERSION') : ;; 'ORGANIZER') : ;; 'UID') : ;; 'SEQUENCE') : ;; 'LOCATION') LOCATION="$VALUE" ;; 'GEO') : ;; 'DESCRIPTION') DESCRIPTION="$VALUE" ;; 'STATUS') : ;; esac done > > > gerard > > > _______________________________________________ > Solaris_fr liste de diffusion en français pour Solaris, sur toutes > architectures > Solaris_fr@x86.sun.com > http://x86.sun.com/mailman/listinfo/solaris_fr -- Christian Pélissier Office National d'Études et de Recherches Aérospatiales BP 72 92322 Chatillon Tel: 33 1 46 73 44 19, Fax: 33 1 46 73 41 50
_______________________________________________ Solaris_fr liste de diffusion en français pour Solaris, sur toutes architectures Solaris_fr@x86.sun.com http://x86.sun.com/mailman/listinfo/solaris_fr