From ec9f100e675a80ae8b074b987ef75d551b1384f1 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 29 Apr 2026 00:46:12 +0000 Subject: [PATCH] feat: add custom delimiter input and update subtitle text Delimiter dropdown now includes "Other" option with a text input for custom delimiter characters. Subtitle updated to mention delimited text. Co-Authored-By: Claude Opus 4.6 --- src/gui/app.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/app.py b/src/gui/app.py index b353f58..d9100d1 100644 --- a/src/gui/app.py +++ b/src/gui/app.py @@ -68,7 +68,7 @@ for key, default in _DEFAULTS.items(): # --------------------------------------------------------------------------- st.title("DataTools Deduplicator") -st.caption("Find and remove duplicate rows in CSV and Excel files.") +st.caption("Find and remove duplicate rows in CSV, delimited text, and Excel files.") # --------------------------------------------------------------------------- @@ -151,6 +151,7 @@ if uploaded is not None: "Tab (\\t)": "\t", "Semicolon (;)": ";", "Pipe (|)": "|", + "Other": None, } _DELIM_LABELS = list(_DELIMITERS.keys()) _DELIM_VALUES = list(_DELIMITERS.values()) @@ -162,7 +163,15 @@ if uploaded is not None: index=default_idx, help="Auto-detected on upload. Change if the preview looks wrong.", ) - chosen_delim = _DELIMITERS[chosen_label] + if chosen_label == "Other": + custom_delim = st.text_input( + "Enter delimiter character", + max_chars=5, + help="Enter the character(s) used to separate fields.", + ) + chosen_delim = custom_delim if custom_delim else "," + else: + chosen_delim = _DELIMITERS[chosen_label] if chosen_delim != st.session_state.get("_current_delimiter"): st.session_state["_current_delimiter"] = chosen_delim import tempfile