Importing PC Contacts csv files into Mac Contacts

I get an error that the csv file is an invalid csv format.

MacBook Pro (M2 Pro, 2023)

Posted on Aug 4, 2024 6:14 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 4, 2024 7:41 AM

That Windows-sourced (you mentioned PC) CSV likely has carriage-return/linefeed pairs after each line of the CSV when macOS expects just an ending linefeed. I also noticed that Excel v16.87 on macOS likes to inject these CR/LF pairs in its saved CSV.


That may be confusing the Contacts import facility. There likely is also no 1:1 correlation between contacts data on Windows and the macOS Contacts application.


Put that CSV on your Desktop if not already there. Then, launch the Terminal application and enter the following commands:


Replace the name foo in the following command with the name of your CSV:


cd ~/Desktop
/usr/bin/tr '\015\012' '\012' < foo.csv > foo_fixed.csv


Now, try importing the output foo_fixed.csv into Contacts.


See: Contacts User Guide for Mac - Apple Support



1 reply
Question marked as Top-ranking reply

Aug 4, 2024 7:41 AM in response to Bobee1967

That Windows-sourced (you mentioned PC) CSV likely has carriage-return/linefeed pairs after each line of the CSV when macOS expects just an ending linefeed. I also noticed that Excel v16.87 on macOS likes to inject these CR/LF pairs in its saved CSV.


That may be confusing the Contacts import facility. There likely is also no 1:1 correlation between contacts data on Windows and the macOS Contacts application.


Put that CSV on your Desktop if not already there. Then, launch the Terminal application and enter the following commands:


Replace the name foo in the following command with the name of your CSV:


cd ~/Desktop
/usr/bin/tr '\015\012' '\012' < foo.csv > foo_fixed.csv


Now, try importing the output foo_fixed.csv into Contacts.


See: Contacts User Guide for Mac - Apple Support



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Importing PC Contacts csv files into Mac Contacts

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.