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