😫 The Pain Point
Survey results come in: “nguyen van a”, “NGUYEN VAN B”, ” Nguyen Van C ”. You can’t print certificates with messy capitalization.
🚀 Agentic Solution
The Beautifier: Applies grammar rules to names.
Key Features:
- Title Case: Converts
nguyen van a->Nguyen Van A. - Trim: Removes double spaces.
⚔️ Phase 1: Commander (Quick Fix)
For a quick cleanup.
Prompt:
“Read
names.txt. Convert every line to Title Case (first letter capitalized). Remove any leading/trailing whitespace. Save toclean_names.txt.”
Result: A clean list.
🏗️ Phase 2: Architect (Permanent Tool)
For Admin Assistants.
Engineering Prompt:
**Role:** Python Data Cleaner
**Task:** Create a "Customer Name Normalizer".
**Requirements:**
1. **GUI:**
* Select Input Excel.
* Select Target Column.
* "Normalize" button.
2. **Logic:**
* `str.title()` (Capitalize first letters).
* `str.strip()` (Remove outer spaces).
* regex `\s+` -> ` ` (Remove double spaces).
* Overwrite column and save.
3. **Deliverables:** `text_normalize.py`, `run.bat` (Windows), `run.sh` (Mac).
🧠 Prompt Decoding
- Spaces: “Nguyen Van A” and “Nguyen Van A ” (space at end) are different to a computer. The generic term “Normalize” in prompt engineering usually implies trimming these invisible chars.
🛠️ Instructions
- Copy Prompt -> Paste -> Run.
- Select File -> Clean.