A console-based Contact Management System implemented in C, designed to manage a collection of contacts with robust input validation, file persistence, and vCard integration.
Prompts for Name, Phone, and Email.
Validates input using regex:
Name → letters, spaces, hyphens, apostrophes (1–49 chars).
Phone → Indian & International formats.
Email → standard email pattern.
Sanitizes inputs (trims whitespace, removes commas).
Adds contact if valid and space is available.
Displays all contacts in a formatted table: Index | Name | Phone | Email.
Supports exact or partial name search (case-insensitive).
Displays results in a table format.
Select a contact by name.
Update Name, Phone, or Email individually.
Empty input retains old value.
Validations applied on new values.
Deletes contact by name with confirmation (Y/N).
Shifts array to maintain order after deletion.
Sorts by Name, Phone, or Email using Merge Sort (O(n log n)).
Saves contacts to contacts.txt in CSV format.
Loads existing contacts at startup.
Handles max contact limit gracefully.
Export: writes contacts to contacts.vcf (vCard 3.0), one phone (CELL) and one email (WORK) per contact.
Import: reads multiple VCARDs from a file, stores last TEL/EMAIL, stops at max contacts.
Regex-based validation for Name, Phone, Email, and menu choices.
Sanitizes inputs to prevent CSV/VCF formatting issues.
Menu-driven system with emoji feedback for actions: ✅, ❌, ℹ️.
Clear prompts and error messages for invalid input.
Navigate to the project directory:
cd path/to/advanced-contact-manager
Compile using make:
make advanced-contact-manager
./advanced-contact-manager
If make is not available, you can compile manually with gcc:
gcc -o advanced-contact-manager advanced-contact-manager.c -Wall -std=c11
./advanced-contact-manager
✅ Tip: Always run ./advanced-contact-manager from the project directory.
advanced-contact-manager/
├── advanced-contact-manager.c # Main C source code
├── contacts.txt # Saved contacts (CSV)
├── contacts.vcf # Exported contacts (vCard)
└── README.md # Project documentation
Note: contacts.txt and contacts.vcf not added here.
Upon starting, the system displays a menu:

✅ Success and ❌ error messages guide the user throughout.
ℹ️ Informational messages appear for no changes or warnings.
CSV File: contacts.txt (Name, Phone, Email)
VCF File: contacts.vcf (vCard 3.0 format)
Maximum of 100 contacts stored in memory at a time.
Automatic loading at startup and saving at exit.
Name, Phone, Email
John Doe, +919876543210, john@example.com
Jane Smith, +14155552671, jane@domain.com
BEGIN:VCARD
VERSION:3.0
FN:John Doe
TEL;TYPE=CELL:+919876543210
EMAIL;TYPE=WORK:john@example.com
END:VCARD
✅ Implemented in C using structs and arrays.
✅ Input validation with regex.
✅ File I/O handling ensures data persistence.
✅ Merge Sort used for efficient sorting.
✅ Case-insensitive operations via strcasecmp().
✅ Memory-safe with bounds checks and input sanitization.
Easy-to-use menu interface.
Supports international phone numbers.
Emoji-based user-friendly feedback.
Import/export to standard vCard for cross-platform compatibility.
Prevent duplicate contacts during vCard import.
Add multiple phone numbers/emails per contact.
Implement search by phone or email.
Integrate graphical UI for better experience.
This project is licensed under the MIT License. See the LICENSE file for details.