This project is a comprehensive data management system designed for pharmacy product inventory, pricing, and application data. It provides a C++ console application for managing and synchronizing product data across multiple sheets (Stock, Price, App), with robust support for CSV, HTML, and Excel file formats. The system also includes Python utilities for file conversion and advanced data processing.
- Features
- Project Structure
- Getting Started
- Usage Guide
- C++ Application Details
- Python Utilities
- Logging
- Build & Configuration
- Contributing
- License
- Multi-format Support: Handles CSV, HTML, and Excel (XLSX/XLS) files.
- Automated Conversion: Converts HTML/Excel sheets to CSV using Python.
- Data Synchronization: Synchronizes App Sheet with Stock and Price Sheets (VLOOKUP-like logic).
- Advanced Operations: Update, add, sort, export, and clean data with a variety of built-in operations.
- Logging: All changes and operations are logged with timestamps.
- Cross-language Integration: Seamless C++ and Python interoperability for data processing.
Updating System V1.4 (Github)/
│
├── main.cpp # Main C++ application (entry point, user interface)
├── operations.cpp/.h # Core data operations (search, update, sync, etc.)
├── file_handler.cpp/.h # CSV file reading/writing utilities
├── logger.cpp/.h # Logging utility (writes to log.txt)
│
├── html_to_csv_converter.py # Python: Converts HTML/Excel to CSV
├── sort_csv_by_column.py # Python: Sorts CSV by column, cleans SKU data
│
├── log.txt # Log file (auto-generated, tracks all changes)
│
├── bin/ # Compiled executables (Debug/Release)
├── obj/ # Object files (build artifacts)
├── .vscode/ # VSCode configuration (optional)
├── Updating System V1.3.cbp # Code::Blocks project file
├── Updating System V1.3.depend/.layout # Build and layout files
- C++ Compiler: GCC (MinGW recommended for Windows)
- Python 3.x: Required for file conversion and sorting scripts
- Python Packages:
pandas,openpyxl
Install with:pip install pandas openpyxl
-
Using Code::Blocks:
OpenUpdating System V1.3.cbpand build the project (Debug/Release). -
Using Command Line (MinGW):
g++ -std=gnu++17 -Wall -o bin/Debug/UpdatingSystem main.cpp operations.cpp file_handler.cpp logger.cpp
-
Ensure Python is in your PATH and required packages are installed.
Run the executable from bin/Debug/ or your build output directory:
./Updating\ System\ V1.exe- The program will prompt for paths to the Stock, Price, and App sheets.
- Supports
.csv,.html,.htm,.xlsx,.xlsfiles. - If a non-CSV file is provided, it will attempt conversion using
html_to_csv_converter.py.
The application provides a menu-driven interface with the following options:
- Search for a product by code (in Stock, Price, or App sheet)
- Update stock in Stock Sheet
- Update price in Price Sheet
- Add a new product (to any sheet)
- Synchronize and update App Sheet (VLOOKUP from Stock/Price)
- Sort App Sheet by SKU & remove rows with multiple numbers in SKU
- Export App Sheet (to a new file)
- Save All Sheets and Exit
- Delete first 10 rows from Price Sheet
- Unmerge columns I & J in Price Sheet
- Move P column (الكود) to H column in Price Sheet
- Delete repeated (السعر) column from Price Sheet
- Delete first 6 columns from Price Sheet
- Set home nursing services stock to 9000000 in App Sheet
- Convert all nan values to 0 in App Sheet
- Handles user interaction, menu, and file input/output.
- Calls Python scripts for file conversion and sorting as needed.
- Manages the main loop and dispatches operations.
- Implements all core data operations:
- Product search, stock/price update, product addition
- App Sheet synchronization (VLOOKUP logic)
- Data cleaning (remove rows, unmerge columns, etc.)
- Exporting and saving sheets
- Provides CSV reading and writing utilities.
- Handles parsing and serializing 2D data.
- Logs all changes and operations to
log.txtwith timestamps.
- Converts HTML tables and Excel files to CSV.
- Can be run standalone or called by the C++ app.
- Usage:
python html_to_csv_converter.py --single-file input.html output.csv
- Sorts a CSV file numerically by a specified column (e.g., SKU).
- Removes rows with multiple numbers in SKU and those with numbers longer than 6 digits.
- Usage:
python sort_csv_by_column.py input.csv output.csv sku
- All significant operations (updates, synchronizations, sorts, etc.) are logged in
log.txt. - Each entry includes a timestamp and a description of the change.
- Code::Blocks: Project file provided (
.cbp). - VSCode: Includes
.vscode/settings for IntelliSense and file associations. - Compiler: Configured for GCC, C++17 standard.
- Dependencies: Only standard C++ libraries and Python packages (
pandas,openpyxl).
This project is licensed under the MIT License. See the LICENSE file for terms.