

Note that this won't work if there's more than one email address in each entry. The d "," option told paste to use a comma to separate each pair of merged lines in the new file.

What paste does is put line 1, file 1 and line 1, file 2 into a new line 1 in a new file, and so on, line by line through the paired files. To create gmail.csv from names.txt and emails.txt, I merged the two files with the paste command. The result was sent to tr, then to cut as for the first command, and emails.txt was written. I told cut that the line consisted of fields ( f) which were delimited ( d) by a blank space, and asked it to report back with the contents of the first field ( f1) only. To remove the remarks="" strings, I used cut again. The final list is written to a new text file, names.txt.Īs shown in the last screenshot, the second command first pulls out the email addresses, but note that grep finds everything up to the last double quote in the line. Here the c4- option tells cut to report everything in each line beginning with the 4th character, or in other words after the first three characters, cn=. The trimmed result is sent to the cut command. The result of the search is sent (piped) to the tr command with the -d option, which in this case deletes the double quotes in the list. The -o option means that grep only reports the strings it finds, not the whole lines. The first command searches with grep for lines containing the string cn="" in the address book. Start with the third screenshot to see how this works for the first entry in the address book. The result was the file gmail.csv on my desktop, looking just like the second screenshot, but listing 174 real names and addresses. Paste -d "," names.txt emails.txt > ~/Desktop/gmail.csv I navigated to the directory ( ~/.sylpheed-2.0) containing the Sylpheed address book, which is called addrbook-000001.xml, and entered the following one-line commands, one after the other: grep -o 'cn=".*"' addrbook-000001.xml | tr -d '"' | cut -c4- > names.txt And lines of text can be manipulated easily in a terminal using simple command line tools.

To understand how I did this, you need to see the address book not as something formatted in a complicated way as XML, but as simple lines of text. I then added Name,Email as the first line of the file and uploaded it to Gmail.
Address book csv converter full#
What I did was extract each full name and its associated email address from this XML file and separate them with a comma, as shown in the second screenshot. The first screenshot shows a typical set of five entries from the 174 in my Sylpheed address book (names and addresses changed, of course).
Address book csv converter code#
The code works but it's pretty simple-minded, and if you're a real programmer and not a hobbyist hacker like me, you may not want to read any further. Warning: What follows contains code that may offend real programmers. Worse, the Sylpheed address book is in XML format, and XML-to-CSV conversion isn't straightforward. Unfortunately, Gmail wants to import contact lists as CSV files, and there isn't an export-address-book-to-csv feature in the otherwise wonderful Sylpheed. If it looks good, then click the Finish button.I recently wanted to export my email address book from Sylpheed email client and import it into my Gmail account.

Click the Choose File button to select your vCard file.Use the image below as a guide as you follow the next steps.Go to the following web site to convert your vCard file to a CSV file:.Save the vCard file on the Desktop or some other convenient location.Click on the File menu and choose Export and then Export vCard.(If you only want some contacts in your Excel file then only select a subset of your contacts.) Click on one contact to select it, then go to the Edit menu and choose Select All.
Address book csv converter mac#
