linuxcaffe / vcf

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

'vcf -G string' to "grep" results, also showing identifying fields #1

Open linuxcaffe opened 9 years ago

linuxcaffe commented 9 years ago

To reduce the output to field names matching $string, the "-G" option to grep (or sed, or whatever) displaying only lines with matching fields, but unlike the "-g" option (issue #5) "-G" also shows the identifying fields FN: and ORG: so then

./vcf -G tel jane ~/contacts/*.vcf

shows (if it were pretty-printed, like #2)

Tarzan U. Jane
Jungle inc
work voice phone: (111) 555-1212

Janet Dammit
home voice phone: (404) 555-1212

l0b0 commented; You can also achieve the same with ./vcf.sh jane ~/contacts/*.vcf | grep -E '^(FN|ORG|TEL)'.