[Evolution] Re: Mozilla address book to evolution
Paul Austin
business@paul.austin.name
Mon, 04 Oct 2004 13:32:37 -0700
--=-rhc3YQvQTu46zz6IDDzp
Content-Type: multipart/alternative; boundary="=-nSJkz6Bpon1zhR4LatAB"
--=-nSJkz6Bpon1zhR4LatAB
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi Doug,
What I did in the end was to write a program to take the CSV file from
Outlook and write an LDIF file with the evolution schema.
I have attached this for reference, if the CSV column field names are
different you can adjust the mapping in this file.
It is written in Python and was tested on Gentoo Linux.
Paul
On Mon, 2004-10-04 at 12:19 -0700, Douglas E. Hopley Jr. wrote:
> Paul,
> Hello - by way of an introduction my name is Doug
> Hopley.
>
> I am working on an address book problem and saw a
> post you had made.
>
> Specifically, I have my president's address book
> which has more than 1400 entries in a mozilla address
> book. One issue that came up is that he is un-able to
> get a print out of the cards that has the formatting
> put into the notes. He has put information like
> directions that have steps seperated on different
> lines. The mozilla (or thunderbird) apps condense
> the lines in the note/other field.
>
> So, I tried .csv files but that also lost the
> formatting.
>
> Now I am working on trying to import, via an .ldif
> export. into evolution. The notes are coming across
> but I am now seeing differeneces in the the 'ldap'
> formats.
>
> Have you had any success in tracking down
> applications that move the data between the two
> applications successfully? That is out of Mozilla (it
> is in the 'mork' format natively, and I have looked
> that and the .csv and the ldif) and into evolution?
>
>
> thanks in advance for your time and responses
>
>
> Let me know if this is not a topic you are spending
> your time on or if there is additional details that I
> can provide.
>
> <dhOPLEY
>
>
>
>
> _______________________________
> Do you Yahoo!?
> Declare Yourself - Register online to vote today!
> http://vote.yahoo.com
--
Paul Austin <business@paul.austin.name>
--=-nSJkz6Bpon1zhR4LatAB
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.2.1">
</HEAD>
<BODY>
Hi Doug,<BR>
<BR>
What I did in the end was to write a program to take the CSV file from Outlook and write an LDIF file with the evolution schema.<BR>
<BR>
I have attached this for reference, if the CSV column field names are different you can adjust the mapping in this file.<BR>
<BR>
It is written in Python and was tested on Gentoo Linux.<BR>
<BR>
Paul<BR>
<BR>
On Mon, 2004-10-04 at 12:19 -0700, Douglas E. Hopley Jr. wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Paul,</FONT>
<FONT COLOR="#000000"> Hello - by way of an introduction my name is Doug</FONT>
<FONT COLOR="#000000">Hopley.</FONT>
<FONT COLOR="#000000"> I am working on an address book problem and saw a</FONT>
<FONT COLOR="#000000">post you had made.</FONT>
<FONT COLOR="#000000"> Specifically, I have my president's address book</FONT>
<FONT COLOR="#000000">which has more than 1400 entries in a mozilla address</FONT>
<FONT COLOR="#000000">book. One issue that came up is that he is un-able to</FONT>
<FONT COLOR="#000000">get a print out of the cards that has the formatting</FONT>
<FONT COLOR="#000000">put into the notes. He has put information like</FONT>
<FONT COLOR="#000000">directions that have steps seperated on different</FONT>
<FONT COLOR="#000000">lines. The mozilla (or thunderbird) apps condense</FONT>
<FONT COLOR="#000000">the lines in the note/other field.</FONT>
<FONT COLOR="#000000"> So, I tried .csv files but that also lost the</FONT>
<FONT COLOR="#000000">formatting. </FONT>
<FONT COLOR="#000000"> Now I am working on trying to import, via an .ldif</FONT>
<FONT COLOR="#000000">export. into evolution. The notes are coming across</FONT>
<FONT COLOR="#000000">but I am now seeing differeneces in the the 'ldap'</FONT>
<FONT COLOR="#000000">formats.</FONT>
<FONT COLOR="#000000"> Have you had any success in tracking down</FONT>
<FONT COLOR="#000000">applications that move the data between the two</FONT>
<FONT COLOR="#000000">applications successfully? That is out of Mozilla (it</FONT>
<FONT COLOR="#000000">is in the 'mork' format natively, and I have looked</FONT>
<FONT COLOR="#000000">that and the .csv and the ldif) and into evolution?</FONT>
<FONT COLOR="#000000">thanks in advance for your time and responses</FONT>
<FONT COLOR="#000000"> Let me know if this is not a topic you are spending</FONT>
<FONT COLOR="#000000">your time on or if there is additional details that I</FONT>
<FONT COLOR="#000000">can provide.</FONT>
<FONT COLOR="#000000"><dhOPLEY</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000">_______________________________</FONT>
<FONT COLOR="#000000">Do you Yahoo!?</FONT>
<FONT COLOR="#000000">Declare Yourself - Register online to vote today!</FONT>
<FONT COLOR="#000000"><A HREF="http://vote.yahoo.com">http://vote.yahoo.com</A></FONT>
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Paul Austin <<A HREF="mailto:business@paul.austin.name">business@paul.austin.name</A>>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
--=-nSJkz6Bpon1zhR4LatAB--
--=-rhc3YQvQTu46zz6IDDzp
Content-Disposition: attachment; filename=OutlookCsv2EvolutionLdif.py
Content-Type: application/x-python; name=OutlookCsv2EvolutionLdif.py
Content-Transfer-Encoding: 7bit
from csv import reader
from csv import DictReader
class OutlookCsv2EvolutionLdif:
headings = []
ldifFields = (
('dn', 'cn=%(Title)s %(First Name)s %(Middle Name)s %(Last Name)s %(Suffix)s,ou=Personal,ou=AddressBook,dc=paul,dc=austin,dc=name'),
('objectClass', 'top'),
('objectClass', 'person'),
('objectClass', 'organizationalPerson'),
('objectClass', 'inetOrgPerson'),
('objectClass', 'evolutionPerson'),
('cn', '%(Title)s %(First Name)s %(Middle Name)s %(Last Name)s %(Suffix)s'),
('sn', '%(Last Name)s %(Suffix)s'),
('mail', '%(E-mail Address)s'),
('mail', '%(E-mail 2 Address)s'),
('mail', '%(E-mail 3 Address)s'),
('anniversary', '%(Anniversary)s'),
('initials', '%(Initials)s'),
('birthDate', '%(Birthday)s'),
('assistantName', "%(Assistant's Name)s"),
('assistantPhone', "%(Assistant's Phone)s"),
('callbackPhone', '%(Callback)s'),
('carPhone', '%(Car Phone)s'),
('companyPhone', '%(Company Main Phone)s'),
('telephoneNumber', '%(Business Phone)s'),
('facsimileTelephoneNumber', '%(Business Fax)s'),
('homePhone', '%(Home Phone)s'),
('homeFax', '%(Home Fax)s'),
('mobile', '%(Mobile Phone)s'),
('pager', '%(Pager)s'),
('primaryPhone', '%(Primary Phone)s'),
('radio', '%(Radio Phone)s'),
('tty', '%(TTY/TDD Phone)s'),
('telex', '%(Telex)s'),
('otherPhone', '%(Other Phone)s'),
('otherFax', '%(Other Fax)s'),
('o', '%(Company)s'),
('ou', '%(Department)s'),
('title', '%(Job Title)s'),
('homePostalAddress', '%(Home Street)s$%(Home Street 2)s$%(Home Street 3)s$%(Home City)s, %(Home State)s$%(Home Postal Code)s$%(Home Country)s'),
('postalAddress', '%(Business Street)s$%(Business Street 2)s$%(Business Street 3)s$%(Business City)s, %(Business State)s$%(Business Postal Code)s$%(Business Country)s'),
('otherPostalAddress', '%(Other Street)s$%(Other Street 2)s$%(Other Street 3)s$%(Other City)s, %(Other State)s$%(Other Postal Code)s$%(Other Country)s'),
('fileAs', '%(Last Name)s %(Suffix)s, %(First Name)s')
)
def __init__(self, inFile, outFile):
self.inFile = inFile
self.outFile = outFile
def convert(self):
out = self.outFile
headings = self.getHeadings()
records = DictReader(self.inFile, headings)
headerRow = records.next()
out.write("version: 1\n\n")
for record in records:
for (key, format) in self.ldifFields:
value = format % record
value = value.replace(" ", " ")
if value and value != '$$$, $$' and value != '0/0/00':
out.write("%s: %s\n" % (key, value % record))
out.write("\n")
out.close()
def getHeadings(self):
if not self.headings:
lines = reader(self.inFile)
self.headings = lines.next()
return self.headings
if __name__ == '__main__':
converter = OutlookCsv2EvolutionLdif(
file('AddressBook.csv'),
file('AddressBook.ldif', "w")
)
converter.convert()
--=-rhc3YQvQTu46zz6IDDzp--