Application Interop
I recieved my new phone (a Sony Ericsson t610) yesterday. Today (at 1:30am) I got my contacts imported.
The story starts with my old phone, a Nokia 8310. On it I had a fair few contacts, all of which I didn't want to loose (especially those girls who gave me their numbers last week ;)). Nokia provides a very robust data suite, with which I was able to synchronize my contacts via infra-red to my PC. So far so good.
Sony Ericsson provide a program called XTNDConnect PC. This synchronizes Outlook data with the phone. Well, ok, not the best protocol, but good enough. So i'm left with a challenge. A phone with no data on it, my outlook contacts db, which has a few thousand email contacts (many i barely know, and don't need in my phone), and my old cell phone db, stored away within the Nokia Data Suite.
Hmm.
I decided to export the Nokia Data into a CSV file. However, this produced results that looked as if someone had sat on the comma key:
,,,BR,,,,,,,,,,,,,,,,,,,,,,,,,,,,08457484950,,,,,,,,,08457484950,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
not only that, but contacts that contained more than one word were out of sync. In short, it was a mess. My first stop was to try importing the data into Outlook -- but where to put it?
I copied my contacts folder to a backup, and imported directly into contacts (after spending time installing the csv 'translator' into outlook). This resulted in a bunch of gobbledy-gook. No good to export to my phone.
Thinking about it, I took the data, and compressed the duplicate commas, giving me something like this:
,BR,08457484950,08457484950,
Well, ok, we still have duplicate numbers, but it's better than nothing. From there, it was into php for a quick routine to process the data. (yeah, perl would have done the job better -- probably python too -- it's just about how well you know the tools of the trade)
Starting with an explode or two, and a foreach, I setup my script to process the data one line at a time. No good! PHP doesn't (yet) allow for recursive foreach. I had to settle for an arraywalk to collate the data...
Once I was done, I had a clean CSV file to import into Outlook. One import later, and my data was clean and ready to export to my phone.
10 minutes later, and my phone is now populated with my contacts db.
Well, two apps, a scripting language, and irda. all this hassle to sync up my phone book. Does it really need to be that hard? why can't Sony Ericsson and Nokia and Samsung and Motorolla and all the rest just share a common format, and then exporting would be a matter of pointing the two phone's irda at each other?
At least it's done, one medium hack later. It could totally have been avoided, however.
cellphonesync
Elsewhere in the archive