Page 1 of 1

PhoneBookEditor (vcf)

Posted: Thu Dec 04, 2025 11:34 am
by AZJIO
I made a program for viewing, deleting, adding, and changing contacts in a vcf file that is exported from the phone. Changing the contact leads to the loss of fields that were not included in the program. It's better to try with a copy of the file first to understand how it works. It is possible that I will redo the way to change the contact by replacing the text in the original, then no fields will be lost.

You will have to correct the item “Replace +7 with 8”, since this is for Russia, you have a different number or there is no double interpretation at all.

Download

screenshot
Image

Re: PhoneBookEditor (vcf)

Posted: Sat Dec 20, 2025 2:34 am
by AZJIO
Updated
Added the source code to generate the phone book for the test.

Re: PhoneBookEditor (vcf)

Posted: Sat Dec 20, 2025 10:46 am
by infratec
I would read in every 'field' in an own entry of the list (sub list or map) than it is easier to replace the value of a field.
And .. you don't loose fields when storing the file.
Maybe it is easier to read the file line by line instead read it in at once.
Since the files are not that large, the speed should still be ok.

Btw, for a PBX system what we use for customers I wrote a ldap server which translates the contacts inside of the PBX to the ldap requests of different phone types.
Unfortunately each manufacturer uses an own way to get the contacts via ldap. ldap is sometimes a bit tricky.

And ... in your sorce code the icon file is missing.
Also an example vcf file would be nice.

Re: PhoneBookEditor (vcf)

Posted: Sat Dec 20, 2025 1:35 pm
by AZJIO
infratec wrote: Sat Dec 20, 2025 10:46 am I would read in every 'field' in an own entry of the list (sub list or map) than it is easier to replace the value of a field.
I output the fields to the structure, but not to the GUI. There are non-standard fields. I wanted to edit the card code; in this mode, the fields will not be lost. But I wanted to do a more complex option: the card is transcoded (=20) from binary to UTF8, and then returned to Ansii, but I’m not sure yet whether this will affect version 3.0 cards, which support UTF8 for the file and do not require recoding. Next, the name is replaced using ReplaceString() in a certain field (in a line), then the lines are again added to the card text. This mode does not require a parameter analyzer and all parameters are returned to the card.
infratec wrote: Sat Dec 20, 2025 10:46 am Also an example vcf file would be nice.
Ok, I'll add a ready-made vcf file, but I made a vcf file generator, you can create 1000 cards (enter a number at start) and run tests with the file.

Also see this
infratec wrote: Sat Dec 20, 2025 10:46 am Maybe it is easier to read the file line by line instead read it in at once.
Yes, it was easier, but I didn’t immediately understand how to add the card code to the structure in this mode. For me, everything between BEGIN and END is placed in a structure element. At the moment I find the BEGIN and END positions and add the text between the positions to the structure element.
infratec wrote: Sat Dec 20, 2025 10:46 am And ... in your sorce code the icon file is missing.
Added
infratec wrote: Sat Dec 20, 2025 10:46 am Also an example vcf file would be nice.
Added

Re: PhoneBookEditor (vcf)

Posted: Wed Dec 24, 2025 11:27 am
by AZJIO
Update
1.3.0
Added a command line to associate vcf with the program.
When adding/changing an item, more fields are available to fill in.
Added items "Move item to position...", "Duplicate item".
Window resizing has been added for child windows.
Fixed the crash of the program when deleting all items.

Re: PhoneBookEditor (vcf)

Posted: Wed Dec 24, 2025 4:41 pm
by miso
Thanks, I will take a look.