Opera Mail 'adr' to Thunderbird 'csv' contacts file converter.

Dwayne Pivac 9d9c9597de fixed typo 2 months ago
.gitignore 52661a9a87 headers comment added and sample contacts,adr in read.me 2 months ago
adr2csv.pl 52661a9a87 headers comment added and sample contacts,adr in read.me 2 months ago
adr2csv.png 0a4b525d49 Initial commit of adr2csv.pl 2 months ago
contacts.example.adr 0a4b525d49 Initial commit of adr2csv.pl 2 months ago
license 135bd08cd6 license added 2 months ago
readme.md 9d9c9597de fixed typo 2 months ago

readme.md

ADR 2 CSV

Opera Mail 'adr' to Thunderbird 'csv' contacts file converter.

I had a difficult time finding a decent, free converter, that does a simple conversion of the old Opera Mail contacts.adr file to CSV format.
So made it myself, and plopping this online for anyone else that may need such a tool.

Usage

perl adr2csv.pl /path/to/file.adr

Output

The file you input determines the output file.
If you input contact.adr you will get a new file called contact.csv
If contact.csv already exists, you'll get contact_01.csv
This number suffix continues until number 99! By then you should have your contacts imported right?

Field Mapping

my %headers_map = (
 # Thnderbird header  => Opera Mail header
 "01_Display Name"    => "NAME",
 "02_Primary Email"   => "MAIL",
 "03_Home Phone"      => "PHONE",
 "04_Fax Number"      => "FAX",
 "05_Web Page 1"      => "URL",
 "06_Notes"           => "DESCRIPTION",
 "07_Nickname"        => "SHORT NAME",
 "08_Home Address"    => "POSTALADDRESS",
 "09_Custom 1"        => "PICTUREURL",
 "10_Secondary Email" => "MAIL"
);

This is a Thunderbird header field map from Opera Mail header field map.
The values on the left are standard Thunderbird header fields.
You can change them to whatever you want, but having ones that Thunderbird understands means you don't need to do the mapping in the UI when you import the CSV file.

Note the number prefixes 01_, 02_ etc. These simply allow us to control the order of the headers.
These numbers ( and the underscore ) are removed from the final output.

Contacts Example File

Here's a sample contacts.adr exported contacts file from Opera Mail.

Opera Hotlist version 2.0
Options: encoding = utf8, version=3

#CONTACT
	ID=11
	NAME=Jim Bob
	URL=https://madeup.address.com/home.html
	CREATED=1775443829
	DESCRIPTION=This is where your notes go...You can add any data here...Maybe a note like - watch this fullah he's a bit dodge...
	SHORT NAME=sir_-_jeff
	ACTIVE=YES
	MAIL=jim_bob@madeup.address.com..jim_bobs_alt_address@madeup.address.com
	PHONE=0800 83 83 83
	FAX=0800 83 82 83
	POSTALADDRESS=153 Jims Street..Coolio Bay..Auckland 12345..New Zealand
	PICTUREURL=https://omi.nz/-/i/profiles/jeff_omi.nz.png
	ICON=Contact15
	M2INDEXID=200000009

#FOLDER
	ID=12
	NAME=Trash
	CREATED=1775443700
	TRASH FOLDER=YES
	UNIQUEID=166CE0D273C2C547B52DE15F8F41EF4D

License

This project is licensed under the GNU General Public License v3.0.
See the license file for the full text.