Re: gnomecard



On Wed, 03 Jan 2001 23:23:28 Billie H. Cleek wrote:
>I converted from Windows last year, and I still haven't transferred all my
>addresses from Outlook to Linux. I have a flat file that I grep, but
>that's inefficient and not the easiest way to look at info. Also,
>importing all my addresses one by one into gnomecard is a boring, long,
>drawn out process at best. 

What format is your flat file? A gawk script should be able to handle the
conversion quite easily.

Assuming a tab-delimited file with columns: Full Name, Last name, First
name, Organization, Phone, and Email.

Pipe the file through this gawk script:

# Set the Field Separator to TAB
{FS = "\t"
# Print the fields with appropriate text for VCF format.
# Edit these lines to match the column order in the tab-delimited file.
print "begin:vcard"
print "fn:"$1
print "n:"$2";"$3
print "org:"$4
print "email;internet:"$6
print "tel:"5
print "end:vcard"
print ""}


Each variable is a column number. The text within double quotes is printed
as-is. Use unix2dos to convert the file to DOS end-of-line format. That's
the standard for VCF files. If you don't have unix2dos installed, open the
file in vi/vim and use the commands:

  :set ff=dos
  :wq

That does the UNIX-to-DOS line conversion just as well.

Then run GnomeCard and use File->Append to import the resulting file.

I was working on a more complex perl script when I remembered that gawk is
tailor-made for this kind of work.

I actually run a local LDAP server for most of my contacts. That way they're
accessible using Balsa, Netscape, and Pine. They also accessible to other
members of my household. I use GQ <http://biot.com/gq/> to maintain the
directory. The directory contains an esentially blank entry that I use as a
template within GQ to add new contacts.

Tony
-- 
Anthony E. Greene <agreene pobox com> <http://www.pobox.com/~agreene/>
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
Chat:  AOL/Yahoo: TonyG05    ICQ: 91183266
Linux. The choice of a GNU Generation. <http://www.linux.org/>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]