From: Dick McCurdy <dickmc@be...> - 2007-04-26 01:03:05
Has antone invented a Sprog machine to convert *.csv files from Outlook
Express addresses to .vcard or .ldif files that Evolution mail uses? I
expected to find more in the recipes section since this is a common
problem. I might try doing it myself if I could find good documentation
for the output formats. Also, does anyone have any examples of recipes
From: Grant McLean <grant@mc...> - 2007-04-26 09:59:56
On Wed, 2007-04-25 at 21:02 -0400, Dick McCurdy wrote:
> Has antone invented a Sprog machine to convert *.csv files from Outlook
> Express addresses to .vcard or .ldif files that Evolution mail uses?
I don't know of any pre-built recipes, but it shouldn't be hard to knock
something together. Do the CSV files from Outlook include column
headings in the first row? If so, then you should be able to use
something like this to convert to LDIF:
* Read File
* CSV Split
* List to Record
* Apply Template (TT2)
* Find and Replace
* Write File
Where the Apply Template gear is configured as per the Perl.com article
(which field name adjustments depending on your CSV file):
> I expected to find more in the recipes section since this is a common
If you'd like to contribute a working recipe, I'd be happy to put it up
on the site.
> I might try doing it myself if I could find good documentation
> for the output formats.
For LDIF, the template in the article should do most of what you want,
here it is as plain text:
dn: uid=[% email %],ou=Staff,ou=People,dc=example,dc=com
cn: [%first_name %] [% surname %]
uid: [% email %]
sn: [% surname %]
givenName: [% first_name %]
mail: [% email %]
organizationName: Example Corp
telephoneNumber: [% phone %]
mobileTelephoneNumber: [% cell %]
Remember the field names in the [% ... %] sections will need to match up
with the column names from your source data (but with tidy-ups as
described in the help for the 'List to Record' gear.
> Also, does anyone have any examples of recipes for images?
The two standard gears that deal with images are fairly limited - adding
a solid colour border and adding some text. You could combine these to
add a copyright message to photos as an example.
The underlying Imager module from CPAN is fairly powerful so whipping up
other gears to do image transformations shouldn't be too hard.
By the way are you running Ubuntu? I'm guessing you're not running
Sprog on the Windows side.