Backing up data from a dead Sony Ericsson T630
Today, a workmate has smashed his Sony Ericsson T630 on the ground and the
display broke. The mobile itself seemed to be alive, though. Now we had
to find out, how to activate the infrared connection to transfer files from
the phone to my computer. After some googline, we found out how to do that in "blind" mode:
Press:
menu button | 8 | 8 | 6 | 2
Afterwards the phone tries to send a file called "Whole phonebook.vcf" to the other side of the infrared
connection. That worked well, _BUT_ this vcf file is of invalid syntax as it contains all contacts in one big vcf
file and therefore we need to split it up. I wrote a small shell script to do that, so if anyone is interested:
#!/bin/bash
# This script contains some bashisms and therefore may need bash,
# especially the counter arithmetic is bashy
#
# Besides that, this script parses a single vcf file generated by many
# Sony Ericsson phones and produces single vcf files (one per contact)
# suitable for importing them into Outlook, etc.
#
# by Alexander Griesser <work@tuxx-home.at> 2007
die() { echo "$*"; exit 1; }
[ "$#" = "1" ] || die "usage: $(basename $0) phonebookfile.vcf"
[ -r "$1" ] || die "cannot read $1"
COUNTER=0
while read line; do
echo "$line" >>$COUNTER.vcf
if echo "$line" | grep -q "^END:VCARD"; then
COUNTER=$((COUNTER + 1))
fi
done < $1
Usage:
# chmod 755 splitupvcf.sh
# ./splitupvcf.sh "Whole phonebook.vcf"
#
Links:
Posted by Alexander Griesser
| Categories:
bash
| Comments:
--> New comment