Skip to content
NMNorthmeld

NORTHMELD PRACTICAL GUIDES

Clean CSV whitespace and duplicates without merging namesakes

Choose what makes a record a duplicate before deleting rows. This example trims surrounding whitespace, lowercases email addresses and removes duplicate full rows. Five input records become four, while two people named Alex remain separate because their other fields differ.

By Northmeld · Published and sample verified:

Prepare and download

Download csv-input.csv and keep an unchanged copy. The five fictional records include one repeated Ada row and two different Alex rows. Import the CSV in the workspace; the three headers should be Name, Email and Country.

Reproduce the result

  1. Check the input

    Confirm that the preview has five data rows and three columns. Ada has spaces around the name and an uppercase email. The Alex records have different email addresses and countries.

  2. Choose the cleanup operations

    Select Trim whitespace, Lowercase email addresses and Remove duplicate rows. Review the plan before applying it. This example compares the full cleaned row, not the Name column alone.

  3. Review changed and removed rows

    Apply the plan. Confirm that Ada becomes Ada / ada@example.com / US and only one repeated Ada record is removed. Both Alex records must remain.

  4. Export four records

    Export CSV or XLSX. Reopen it and compare against the output table below. If the row count or surviving records differ, review the plan and source before replacing any working dataset.

Sign in to try the sample

Actual sample results

Input data rows
5
Output data rows
4
Duplicates removed
1
  • Five input rows become four output rows; one full-row duplicate is removed.
  • Surrounding name whitespace and email letter case are normalized before comparing duplicates.
  • The two Alex rows survive because they are not identical full records. Matching a name alone is not enough to establish identity.

Quotes below identify text values and reveal surrounding spaces; they are not part of the cell. Numbers are shown without quotes.

Before cleanup
NameEmailCountry
" Ada ""ADA@EXAMPLE.COM""US"
"Lin""lin@example.com""SG"
" Ada ""ADA@EXAMPLE.COM""US"
"Alex""alex@example.com""US"
"Alex""alex.other@example.com""CA"
Exported result
NameEmailCountry
"Ada""ada@example.com""US"
"Lin""lin@example.com""SG"
"Alex""alex@example.com""US"
"Alex""alex.other@example.com""CA"

Download verification records (including source SHA-256)

Limits and human review

  • Repeated transactions may be legitimate even when every displayed field matches. Use a transaction identifier or source context before deleting records.
  • Email lowercasing is an explicit normalization choice. If your downstream system treats address case as meaningful, omit that operation.
  • This sample does not merge customers, validate mailbox ownership or decide which conflicting customer record is authoritative.

Read about local and cloud data handling

Continue reading

Report an issue or get help