Friday, May 8, 2009

Retreiving lost e-mail contacts

Last month I faced some trouble with my yahoo webmail account. There was a virus attack in my mail box and it sent some random product promotional mail to all the contacts in my contact list. This was lesser of the problem as I only had to send a follow up mail cautioning every one in my contact list about the virus attack. But after a week or so, all my contacts were deleted from my contact list! I had never backed up my contacts and hence this was a jolt to me. However, I was lucky to find a copy of the mail sent by the virus in my sent items folder. This mail had all my contacts in the 'To' list. There were well beyond a 100 contacts which I had to manually enter in my address book. Yahoo supports contact imports only from specific formats like .csv etc. The problem was to enter the contacts from the sent mail to .csv file so that all the contacts can be imported at one shot. So I used the following trick:

1. I copy-pasted everthing under 'To' list to a text file. This will have one long line of all the contact names, there mail ids with < > and separated by a comma
2. Opened this text file in Textpad, a very useful text editor.
3. I had to get all the contacts in vertical order in a column format to be copied into a .csv file. So I recorded a macro in Textpad to search for comma and replace it with Enter key. Now I played the macro until all the contacts moved into new lines. This resulted in vertical (column aligned) ordering of my contacts. (Note that you can not use Find/Replace function to replace any character with new line!)
4. Some slight adjustments had to be done for which I copied this ordered contacts into a Microsoft excel and used 'Text to columns' function to achieve them same.
5. Exported my contacts from yahoo as .csv which gave a blank csv file as all the contacts were deleted. Copied the ordered contacts into this .csv file and imported into yahoo contacts. Boom!!! My contacts were back :)

No comments: