Convert Massive VCard file into individual files
Jump to navigation
Jump to search
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