Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Decode contact list from Nokia phone.

by ambrus (Abbot)
on Apr 05, 2016 at 21:03 UTC ( [id://1159650]=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -e 'use warnings; use 5.016; use MIME::Base64; use Encode; use Un
    +icode::Collate::Locale; my$U=Unicode::Collate::Locale->new(locale=>"h
    +u"); my(@o,@u); for my$N (glob("$ARGV[0]/predefhiddenfolder/backup/WI
    +P/32/contacts/*.vcf")) { open my$C, "<", $N or die; my @r; while(<$C>
    +) { /\V/ or next; /\A([^:;]*)(?:;([^:]*))?:([^\n\r;]*)\r?\Z/ or do{wa
    +rn "ignoring in $N: $_"; next}; my($k,$e,$v)=($1,$2//"",$3); "ENCODIN
    +G=BASE64"eq$e and $v=decode_base64($v); "X-NOKIA-PND-GROUP"eq$k and $
    +v=encode_utf8(decode("utf16le",$v)=~s/\0\z//r); if("BEGIN"eq$k||"VERS
    +ION"eq$k||"END"eq$k){next}else{my$b=("N"eq$k||"TEL"eq$k)?"":"$k=";pus
    +h@r,$b.$v} }; push@o,join(";",@r)."\n"; push@u,chr($r[0]=~/^\+/).$U->
    +getSortKey(decode_utf8($r[0])); } print @o[sort {$u[$a]cmp$u[$b]} key
    +s@u];' Backup015 > cont.txt
    
  2. or download this
    perl -e 'use warnings; use 5.016; use MIME::Base64; use Encode;  binmo
    +de STDOUT,":encoding(utf8)"; my@o; for my$N (glob("$ARGV[0]/predefhid
    +denfolder/backup/WIP/32/contacts/*.vcf")) { open my$C, "<", $N or die
    +; my @r; while(<$C>) { /\V/ or next; /\A([^:;]*)(?:;([^:]*))?:([^\n\r
    +;]*)\r?\Z/ or do{warn "ignoring in $N: $_"; next}; my($k,$e,$v)=($1,$
    +2//"",$3); "ENCODING=BASE64"eq$e and $v=decode_base64($v); "X-NOKIA-P
    +ND-GROUP"eq$k and $v=encode_utf8(decode("utf16le",$v)=~s/\0\z//r); if
    +("BEGIN"eq$k||"VERSION"eq$k||"END"eq$k){next}else{my$b=("N"eq$k||"TEL
    +"eq$k)?"":"$k=";push@r,$b.$v} }; push@o,decode_utf8(join(";",@r)."\n"
    +); } print sort({fc$a cmp fc$b} @o);' Backup015 > contacts.txt
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://1159650]
Approved by choroba
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-20 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found