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

Re: Contacts printing



On Sun, Nov 04, 2007 at 08:51:25PM +0100, Rodolfo Medina wrote:
> On Mon, Oct 29, 2007 at 01:12:06PM +0100, Rodolfo Medina wrote:
> 
> >>>>>>> I wish a way to print the
> >>>>>>> Contacts (about 300) that I have stored in a directory, one per file.
> 
> 
> 
> Douglas A. Tutty" <dtutty@porchlight.ca> writes:
> 
> >>>>>> 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.
> 
> 
> 
> Rodolfo:
>   
> >>>>> 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?
> >>>>
> >>>> I want to cat all those file into one file and then sort the above
> >>>> entries, I
> >>>> don't know how.  I also want to eliminate redundant symbols and words like
> >>>> `BEGIN:VCARD', `END:VCARD', `N:;', `VERSION:2.1' etc.
> 
> 
> 
> 
> 
> 
> Raj Kiran Grandhi <grajkiran@gmail.com> writes:
> 
> > The following line will get you your contacts in a format you can import into
> > a spreadsheet.
> >
> > $ for file in /path/to/dir/*;do tail -n4 $file|head -n 3 \
> > |cut -f 2 -d :|xargs echo $(basename $file);done
> >
> > That will put the filename, the two phone numbers and name in each line. You
> > might want to replace the spaces with comma's and save the file to some name
> > ending with .csv to ease import into a spreadsheet
> 
> 
> Thanks!, the file is imported into the spreadsheet.  But the items are still
> not sorted, which remains the main problem (besides some coding problems).
> Any hint about that?
Sorted how?
-- 
|  .''`.  == Debian GNU/Linux == |       my web site:           |
| : :' :      The  Universal     |mysite.verizon.net/kevin.mark/|
| `. `'      Operating System    | go to counter.li.org and     |
|   `-    http://www.debian.org/ |    be counted! #238656       |
|  my keyserver: subkeys.pgp.net |     my NPO: cfsg.org         |
|join the new debian-community.org to help Debian!              |
|_______  Unless I ask to be CCd, assume I am subscribed _______|



Reply to: