The same rows, twice

Overlapping exports, retried jobs and weekend reruns all leave repeated rows in the data. Merging the files first and then hunting duplicates by hand is tedious - and the header row repeats itself too.

Download free trialBuy TextMerger

How to remove duplicate lines while merging

  1. Open TextMerger and click New Task.
  2. Add the files you want to merge.
  3. Tick Remove duplicate lines, and Skip empty lines if the files have blank rows between blocks.
  4. Click Merge - the filters run as the output is written, in one pass.

TextMerger merging CSV exports with the remove duplicate lines option

Two different kinds of duplicate

How the filters work

TextMerger merging overlapping CSV exports with Skip empty lines and Remove duplicate lines ticked

The result

A January export, a February export and a re-run of February, merged with the filters on: the repeated header, the blank line and the duplicated February rows are gone, and what is left is one clean set of rows:

The merged CSV in the preview with duplicate rows and blank lines removed

What it does not do

It compares whole lines - it is not a database de-duplication. Rows that mean the same thing but differ in spacing, case or column order are still different lines. If you need key-based de-duplication, load the merged file into a database and use that instead.

Related tools

Loading the merged, cleaned file into a database: FileToDB. Converting the format afterwards: DataFileConverter. Full reference: merging text files. Related use case: twelve monthly exports.