linuxcaffe / vcf

vCard find
GNU General Public License v3.0
0 stars 0 forks source link

'vcf -p' pretty-print output #5

Open linuxcaffe opened 9 years ago

linuxcaffe commented 9 years ago

vcf output would be more readable (useful) if it were "pretty-printed", removing all unnecessary elements, adding space between cards. so with command

./vcf.sh -p gump ~/contacts/*.vcf

turns this;

BEGIN:VCARD
VERSION:3.0
N:Gump;Forrest;;Mr.
FN:Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO;VALUE=URL;TYPE=GIF:http://www.example.com/dir_photos/my_photo.gif
TEL;TYPE=WORK,VOICE:(111) 555-1212
TEL;TYPE=HOME,VOICE:(404) 555-1212
ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
LABEL;TYPE=WORK:100 Waters Edge\nBaytown, LA 30314\nUnited States of America
ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
LABEL;TYPE=HOME:42 Plantation St.\nBaytown, LA 30314\nUnited States of America
EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com
REV:2008-04-24T19:52:43Z
END:VCARD

into this:

Forrest Gump
Bubba Gump Shrimp Co.
Shrimp Man
photo: http://www.example.com/dir_photos/my_photo.gif
work voice phone: (111) 555-1212
home voice phone: (404) 555-1212
work address: 100 Waters Edge, Baytown, LA, 30314, United States of America
home address: 42 Plantation St, Baytown, LA, 30314, United States of America
email: forrestgump@example.com

pretty-printing would also add a blank line between cards.