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

Re: Contacts printing



On Mon, Oct 29, 2007 at 12:33:32AM +0100, Rodolfo Medina wrote:
> On Sun, Oct 28, 2007 at 11:56:02PM +0100, Rodolfo Medina wrote:
> 
> >> I managed to sync my mobile phone to the PC with opensync, so I copied the
> >> Contacts into the file system.
> >> 
> >> Then I fetched them with Evolution, but I don't like the way it prints them
> >> out, and it doesn't seem to be customizable.
> >> 
> >> If anyone out there has experience with the matter, I wish a way to print the
> >> Contacts (about 300) that I have stored in a directory, one per file.
> >> Thunderbird does not seem to work: it can't import them.
> 
> > One contact record per file???  Sounds like something windows would do.
> 
> It's just the way opensync works when using the file-sync plugin.
> 
> > I think you just need to write a script in your favorite language to
> > parse the files and format it to your liking then just print it out.
> >
> > In what languages can you program?  (bash, python, perl, ada, C,
> > Fortran...)?
> 
> Every file is like this:
> 
> BEGIN:VCARD
> VERSION:2.1
> N:;Oliver Hardy ;;;
> TEL;CELL:3391234567
> TEL;VOICE;HOME:081123567
> FN:Oliver Hardy
> END:VCARD
> 
> , so the major problem would be sorting: how to sort whole items like that?
> *Is* it possible, and any idea of how?

Well its possible.  The how is back to your choice of language.  If you
want to use grep, you could just rgrep them or something.  

If you just want a list printed, assuming that there is at least a blank
line at the top or bottom of every file, you could just cat them
together then print the file.  It won't be sorted unless the file names
are sorted already.

You could use python to read the files, and create your printout; it
could even put it into a database for you.

So, assume that anything is possible:

1.	What do you want to do?

2.	In what language do you want to do it?

Doug.



Reply to: