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

  1. Paste your list into Text Fixer. One entry per line.
  2. Enter the marker in Delete Before or Delete After. Whatever character or string separates the part you want from the part you don't.
  3. Toggle Inclusive if you want the marker itself removed too. Leave it off to keep the marker in the result.
  4. 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.

Open Column Extractor →

Frequently Asked Questions

How do I delete everything before a specific character in every line of a list?
Paste your list into Text Fixer and set Delete Before to the marker character (a comma, colon, dash, whatever splits your data). Every line is trimmed to keep only what comes after the marker.
How do I delete everything after a specific character instead?
Use the Delete After option with the same marker. Every line is trimmed to keep only what comes before it - the reverse of Delete Before, useful for stripping a trailing suffix, extension, or annotation from every line.
Do I keep the marker character itself, or does it get removed too?
Your choice - both Delete Before and Delete After have an Inclusive toggle. Turn it on and the marker is removed along with the text on the specified side; turn it off and the marker stays as part of the result.
What's the Excel equivalent, and why use a browser tool instead?
Recent Excel versions have TEXTBEFORE() and TEXTAFTER() functions built for exactly this. Older versions need a formula combining RIGHT, LEN, and FIND, or a Find & Replace using a wildcard pattern like *, 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?
The first occurrence in the line is used. If a line is 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?
That line is left unchanged. Delete Before/After only modifies lines where the marker is actually found, so a mixed list with some lines missing the delimiter won't have those lines emptied out or broken.
Can I combine this with other cleanup, like trimming or sorting?
Yes. Delete Before/After runs alongside every other Text Fixer option in the same pass - trim whitespace, remove duplicates, sort, change case - so a list can be trimmed to the relevant portion and cleaned up in one paste rather than several separate tools.
Can the marker be more than one character, like a multi-character delimiter?
Yes, the marker field accepts any string, not just a single character - a two-character delimiter like :: or a word like ID: works the same way as a single character.

Share this tool

Featured on ToolDirs
© 2026 ListDiff

Free online list and text processing tools.