The TinyToolbox Remove Duplicate Lines tool keeps the first occurrence of each exact line. If a list starts with Harbor, then Market, then Harbor again, the result starts with Harbor and then Market. The second Harbor line is removed even though another entry appears between the two copies.
This is useful when you have a plain-text list in a deliberate order. You might be combining two checklists, collecting distinct labels from several drafts, or reviewing repeated entries in an export. Start by deciding whether every line is an independent item and whether identical items should occur only once. Repeated lines can also represent separate events or quantities, so the meaning of a line matters as much as its spelling.
Paste a sample and check the result
- Open Remove Duplicate Lines.
- Paste the list into Input text, with one item per line.
- Select Run tool.
- Compare the output order with the source.
- When the result matches your intent, select Copy result.
Try this list:
Harbor
Market
Harbor
Library
Market
The result is:
Harbor
Market
Library
The earliest Harbor stays at the top and the earliest Market stays second. Library keeps its position relative to the entries that remain. The tool does not sort the names alphabetically. If you expected a sorted list, do the sorting as a separate step once you have confirmed which duplicates can be removed.
Save the original before replacing a working list. The cleaned output does not identify how many times a particular item occurred or where its later copies appeared. If you need to preserve frequency, add a separate tally from the source instead of relying on the deduplicated result to reconstruct it.
Check what counts as an exact duplicate
The tool compares the entire line as text. Capitalization, spaces, and punctuation are part of that comparison. These examples show some differences it preserves.
| First line | Later line | Result |
|---|---|---|
Room 4 |
Room 4 |
Keeps the first occurrence |
Room 4 |
room 4 |
Keeps both because the capitalization differs |
Room 4 |
Room 4 |
Keeps both because the second has two internal spaces |
Room 4 |
Room 4. |
Keeps both because of the period |
Room 4 |
Room 04 |
Keeps both because the number is written differently |
A leading space, tab, or trailing space can also make a line distinct. Two lines can look identical in a displayed list while one ends in an extra space. If an apparent duplicate survives, check it with an editor that can show whitespace. Confirm whether the extra whitespace belongs to the data before removing it. For example, indentation can indicate a subsection in an outline, even though it might be irrelevant in a list of room labels.
Visually identical text can also have different Unicode representations. An accented character might be stored as one precomposed letter or as a base letter followed by a combining mark. The tool compares the strings it receives and does not normalize those forms. If a receiving system treats such representations as equivalent, apply its normalization rule to a separate working copy before checking for duplicates.
Preserve the first occurrence you actually want
For two lists, put the preferred source first if you want its order to take priority. Suppose your primary checklist contains Inspect lights, Check doors, and Confirm keys. A supplemental list has Check doors and Review signs. Paste the primary items above the supplemental ones. The output retains the primary sequence and adds Review signs at the end.
If you paste the supplemental list first, Check doors moves to the top because that is where its first occurrence now sits. Both results contain the same distinct entries, but the sequence differs. Choose the order intentionally when it represents a schedule, a priority, or the order in which a reader should perform the steps.
Keep any headings or category labels outside the operation when they should appear in the final text more than once. For example, two sections can each have a line called Before opening. Deduplicating the combined outline removes its second exact appearance even if it belongs to another section. If repetitions only matter within each section, run the sections separately and restore their headings in the original structure.
Watch for blank lines when the list has groups
The tool splits the input at line breaks. An empty line is a line with no text, so the first empty line stays and later empty lines are removed. A line containing a space may look empty but is a different string. A trailing newline can also produce an empty final line in the input. Where precise layout matters, check the output for blank space at the start or end before pasting it into another document.
Suppose a source has three shopping groups separated by blank lines. Combining all the text in one run can remove an empty separator after the first one. It can also remove an item from a later group if the same text appeared in an earlier group. If each group needs its own structure and can legitimately contain the same item as another group, process one group at a time. Keep the separators in the destination document while replacing each list body.
Line ending conventions are a separate detail. The tool accepts line feeds and carriage-return-plus-line-feed pairs as separators and joins its results with line feeds. If the original was a file with a required line-ending convention, check that convention after copying the result. This matters for a plain-text export that must match another application’s expectations.
Compare full lines when records have several fields
Imagine an export containing these rows:
W04,West gate,Open
W04,West gate,Open
W04,West gate,Closed
E02,East gate,Open
The first two rows match exactly, so one stays. The closed record stays too because its status differs. The tool compares the whole row and cannot choose which record to retain based on a single field such as W04. If your task requires one record per gate, decide what the controlling field is and which status or date should win. Use a field-aware workflow for that operation.
The same concern applies to comma-separated data with quoted fields that span multiple lines. A physical line break can occur inside one record. The duplicate-line tool sees physical lines and does not interpret CSV quoting. Work with parsed records if the data has multiline values. With a simple one-record-per-line export, preserve the header separately and check the number and meaning of the remaining rows before importing them.
A repeated row can be meaningful even when all visible fields agree. Two equal quantities might describe two separate transactions. If you know each row represents an event, preserve the source until you can distinguish duplicate copies from distinct events that happen to have the same values. Removing textually identical records changes a count and may affect later totals.
Prepare a separate copy when you want a looser comparison
Suppose a draft inventory contains North store, north store, and North store with a trailing space. The exact comparison retains all three. If the inventory’s rules define those as one label, choose a normalization rule explicitly. For example, a working copy might remove leading and trailing spaces and convert the labels to lowercase before running the duplicate-line operation.
Keep the source labels if their original capitalization is needed on signs or reports. A normalized north store can be a useful comparison key while North store remains the display name. Record which spelling you want to present rather than replacing all the originals without a check. Apply the same normalization to the full set before comparing, so earlier and later rows follow the same rule. Text Case Converter
Test the rule against an entry that should stay distinct. For instance, if Room 04 and Room 4 might identify different rooms, preserve their digits even while trimming incidental spaces. A simple test set can contain one exact duplicate, one equivalent label under your rules, and one label that must remain distinct. Inspect the result before extending the workflow to a larger import.
Verify the resulting list in its destination
Compare the cleaned count with the source when the count matters. In the opening example, five input rows became three, because there were two later exact repetitions. Check a repeated item that appears near the end and an item that should remain despite a small difference. This catches a mistaken assumption that the tool compares by category, lowercases the data, or changes the order.
Paste the output into its destination and review the formatting again. An editor can render tabs differently or trim the ends of pasted lines. If the destination sorts entries automatically, its final order may differ from the order you inspected in the tool. Keep the cleaned plain-text copy if that order needs to be reproduced elsewhere.
For a repeatable handoff, save the source selection, whether you normalized anything first, and which occurrence you intended to preserve. A note such as “combined primary and supplemental checklists, kept the earliest exact copy in the combined order, retained both section headings separately” gives the next reader enough information to run the same check. When a newer source arrives, review its boundaries before reusing the workflow.