How to Delete Everything Before or After a Specific Character in a List
A list like Product: Widget A, Product: Widget B has a label you want stripped from every line, keeping just Widget A, Widget B. Or the reverse - a trailing note or file extension you want removed from the end of every line. Doing this one line at a time is fine for five lines and unworkable for five hundred.
Quick answer
Paste the list into Text Fixer and set Delete Before or Delete After to the character (or string) that marks the split point. Delete Before strips everything up to that marker on every line; Delete After strips everything past it. An Inclusive toggle controls whether the marker itself is kept or removed too.
Clean up your list now. Free, no account needed.
Open Text Fixer →How to do it
- Paste your list into Text Fixer. One entry per line.
- Enter the marker in Delete Before or Delete After. Whatever character or string separates the part you want from the part you don't.
- Toggle Inclusive if you want the marker itself removed too. Leave it off to keep the marker in the result.
- Copy the result.
A list like this, with Delete Before set to : and Inclusive on:
Product: Widget A Product: Widget B Product: Widget C
becomes:
Widget A Widget B Widget C
Delete After: the reverse direction
Delete After works the same way but keeps everything before the marker instead. Useful for stripping a trailing annotation, a file extension, or anything appended after a consistent delimiter - report_final.csv with Delete After set to . and Inclusive on becomes report_final.
Multiple occurrences and missing markers
If a line contains the marker more than once, the first occurrence is used - a,b,c with Delete Before on the comma (inclusive) becomes b,c, not just c. If a line doesn't contain the marker at all, it's left completely unchanged rather than emptied out, so a mixed list is safe to run through even if not every line has the delimiter.
The Excel alternative, for comparison
Recent Excel versions have TEXTBEFORE() and TEXTAFTER() functions purpose-built for this. Older versions need a formula combining RIGHT, LEN, and FIND, or a Find & Replace using a wildcard like *, to match "everything up to a comma." All of these require writing or looking up a formula and applying it down a column - worthwhile if this needs to live in a spreadsheet permanently, but more setup than a one-off list needs.
Need to split on every occurrence instead?
Column Extractor and CSV Splitter handle repeated delimiters across a full row.
Frequently Asked Questions
How do I delete everything before a specific character in every line of a list?
How do I delete everything after a specific character instead?
Do I keep the marker character itself, or does it get removed too?
What's the Excel equivalent, and why use a browser tool instead?
*, to match everything up to a character. All of these require writing or copying a formula into a helper column first; pasting into a browser tool skips the formula entirely for a one-off list.What happens if a line has multiple instances of the marker character?
a,b,c and you delete everything before the first comma, you get b,c - not just c. If you need to split on every occurrence rather than just the first, a column extraction or CSV split is the better tool.What if a line doesn't contain the marker character at all?
Can I combine this with other cleanup, like trimming or sorting?
Can the marker be more than one character, like a multi-character delimiter?
:: or a word like ID: works the same way as a single character.