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)'.
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
shows (if it were pretty-printed, like #2)
l0b0 commented; You can also achieve the same with ./vcf.sh jane ~/contacts/*.vcf | grep -E '^(FN|ORG|TEL)'.