Difference between revisions of "Convert Massive VCard file into individual files"
Jump to navigation
Jump to search
Michael.mast (talk | contribs) (Created page with "Apple would export MacOS contacts in vcard format, but only as a single file. Below pulls these out as individual files for importing into other programs that do not support t...") |
Michael.mast (talk | contribs) |
||
Line 1: | Line 1: | ||
Apple would export MacOS contacts in vcard format, but only as a single file. Below pulls these out as individual files for importing into other programs that do not support this master file format (ie MS Outlook). | Apple would export MacOS contacts in vcard format, but only as a single file. Below pulls these out as individual files for importing into other programs that do not support this master file format (ie MS Outlook). | ||
<pre> | <pre> | ||
− | contact="1";while read line; do if ! grep -q "END:VCARD" <<<$line ; then echo $line >> contact_$contact. | + | contact="1";while read line; do if ! grep -q "END:VCARD" <<<$line ; then echo $line >> contact_$contact.vcf; elif grep -q "END:VCARD" <<<$line; then echo "$line" >> contact_$contact.vcf; contact=$((contact + 1));fi;done < master.vcard |
</pre> | </pre> | ||
<br> | <br> |
Latest revision as of 13:58, 21 February 2018
Apple would export MacOS contacts in vcard format, but only as a single file. Below pulls these out as individual files for importing into other programs that do not support this master file format (ie MS Outlook).
contact="1";while read line; do if ! grep -q "END:VCARD" <<<$line ; then echo $line >> contact_$contact.vcf; elif grep -q "END:VCARD" <<<$line; then echo "$line" >> contact_$contact.vcf; contact=$((contact + 1));fi;done < master.vcard
If you want to convert this list into a CSV file that can be used by Outlook there are two ways to do this.
- Import into Windows Contacts first, then export as CSV[1]
- Write a script for converting each file into CSV format. This would be best but I am doing what I can to ensure compatibility with crazy MS Outlook. Will revisit later.
- ↑ https://www.msoutlook.info/question/726