Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] Esportare i contatti da Evolution a GMail
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
assente
Guru
Guru


Joined: 12 Apr 2004
Posts: 570
Location: Torino, italia, New Europe

PostPosted: Sat Dec 04, 2004 2:56 pm    Post subject: [TIP] Esportare i contatti da Evolution a GMail Reply with quote

Non ho trovato uno script che mi permettesse di farlo, quindi me ne sono fatto uno io; ho notato che l'email viene scritta nel vcf da evo con tag diversi, a seconda della versione di Evolution, quindi il mio consiglio è controllare che sia sempre lo stesso: EMAIL;TYPE=WORK;X-EVOLUTION-UI-SLOT=1: oppure EMAIL:
Spero che questo script possa servire anche a qualcun'altro. :wink:

Non è molto che uso Ruby, ma sono sicuro che si può fare la stessa cosa in maniera più elegante e compatta.. :P Se avete qualche idea, fatemelo sapere!

Code:

#! /usr/bin/ruby
=begin
  vcf2csf - Export vcffile to csvfile
  $Author: Assente $
  Copyright (C) 2004 assente.altervista.org
  This program is free software.
  You can distribute/modify this program under
  the terms of the GPL  License.
=end
# CONFIG ME
vcfwords=["FN:","EMAIL;TYPE=WORK;X-EVOLUTION-UI-SLOT=1:","TEL;TYPE=CELL;X-EVOLUTION-UI-SLOT=3:"]
csvwords=["Full Name","Email Address","Mobile"]
#
if (ARGV[0]=="--help" || ARGV[0]==nil || ARGV[1]==nil)
   puts "Usage: ./vcf2csf.rb [] []
Function: Convert a vcffile to csvfile, usefull to export contacts from Evolution to GMail"
else
   vcffile=ARGV[0]
   csvfile=ARGV[1]
   csv=""
   rows=open(vcffile).readlines
   for i in 0..rows.length-1
      if rows[i].slice(0,5)=='BEGIN'
         csv << "\n"
      end
       for j in 0..vcfwords.length-1
   
         if rows[i].slice(0,vcfwords[j].length)==vcfwords[j]      
            csv << rows[i].slice(vcfwords[j].length,30).chomp
            csv << ","
         end
      end
   end
   c=open(csvfile,'w+');
   c.write(csvwords.join(",")+csv)
   c.close
end

_________________
Blog
E8400, 4850, P5q
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum