- fprintf(out, "\"NAME\",");
- fprintf(out, "\"EMAIL\",");
- fprintf(out, "\"ADDRESS\",");
- fprintf(out, "\"ADDRESS2\",");
- fprintf(out, "\"CITY\",");
- fprintf(out, "\"STATE\",");
- fprintf(out, "\"ZIP\",");
- fprintf(out, "\"COUNTRY\",");
- fprintf(out, "\"PHONE\",");
- fprintf(out, "\"WORKPHONE\",");
- fprintf(out, "\"FAX\",");
- fprintf(out, "\"MOBILEPHONE\",");
- fprintf(out, "\"NICK\",");
- fprintf(out, "\"URL\",");
- fprintf(out, "\"NOTES\",");
- fprintf(out, "\"ANNIVERSARY\",");
- fprintf(out, "\"GROUPS\"\n");
+ int i = 0;
+ while(allcsv_export_fields[i+1] != CSV_LAST) {
+ fprintf(out, "\"%s\",", standard_fields[i++].key);
+ }
+ fprintf(out, "\"%s\"\n", standard_fields[i].key);