Key Takeaways
- Google Sheets opens, edits and exports CSV files for free, with no add-on and no third-party upload.
- TRIM, CLEAN, SUBSTITUTE, SPLIT and UNIQUE cover most routine CSV tidying on text columns.
- Data cleanup and the split text to columns tool reshape a file without writing a formula.
- Near-duplicates, fuzzy matching and very large files are where the sheet runs out and Flookup takes over.
Introduction
CSV files arrive from CRMs, ERPs, payment processors, analytics tools and databases. Most of them need a small edit before anyone can trust the contents: a trimmed column, a fixed date, a duplicate removed or a merged field split apart.
You do not need a dedicated editor for that. Google Sheets is already a free CSV editor, and it runs in the browser you are using now. It imports the file, lets you clean it with ordinary functions and exports it again in the same format.
This guide walks through that workflow from start to finish. It uses only what ships with Google Sheets, so there is nothing to install. An optional Apps Script snippet is included for repetitive cleanup, and the final section explains where the spreadsheet method stops.
Import a CSV File into Google Sheets
Open a blank spreadsheet and choose File and Import. Upload the CSV, then pick the separator. Comma is the default, but exports from European systems often use a semicolon and some tools use a tab.
Sheets normally detects the separator correctly. If an entire row lands in column A, import the file again and set the separator yourself rather than trying to split it afterwards.
The import dialog also lets you convert text to numbers and dates. Leave that option on for clean exports and turn it off for identifiers such as order numbers that begin with a zero, because a converted identifier loses its leading digit.
| Import setting | When to use it | What it changes |
|---|---|---|
| Separator | The preview shows everything in one column | Places each field in its own column |
| Convert text to numbers and dates | Amounts, dates and percentages | Enables arithmetic and date sorting |
| Convert text to numbers and dates, off | Codes, postcodes and phone numbers | Keeps leading zeros and punctuation |
Clean the File with Built-in Functions
Add a helper column beside the data, apply a function, then copy the result back over the original column if you want the change in place. These functions cover the common CSV faults.
| Function | What it does | Example |
|---|---|---|
| TRIM | Removes leading and trailing spaces and collapses repeated internal spaces | =TRIM(A2) |
| CLEAN | Strips non-printable characters that break sorting and matching | =CLEAN(A2) |
| SUBSTITUTE | Replaces one piece of text with another | =SUBSTITUTE(A2, "St.", "Street") |
| REGEXREPLACE | Replaces text that matches a pattern | =REGEXREPLACE(A2, "[^0-9]", "") |
| SPLIT | Breaks one cell into several columns | =SPLIT(A2, ", ") |
| TEXTJOIN | Joins several columns into one value | =TEXTJOIN(", ", TRUE, A2:C2) |
| UNIQUE | Lists the distinct values in a range | =UNIQUE(A2:A) |
| PROPER, UPPER and LOWER | Fixes casing without retyping the values | =PROPER(A2) |
Work one column at a time. Trim the text columns first, because a stray space makes two identical values look different to every later step, including duplicate removal and lookups.
The standardise tools in Flookup apply the same idea across a whole sheet with a single menu action and a preview before anything is written.
Remove Duplicate Rows
Select the data, then choose Data, Data cleanup and Remove duplicates. Sheets reports how many rows it removed. The comparison is exact, so trim spaces and fix casing first if the duplicates look identical on screen.
To review before deleting, add a helper column with =COUNTIF($A$2:$A, A2). Any value above one marks a repeated key, and you can sort by that column to inspect the groups.
For a single column of values, =UNIQUE(A2:A) produces a clean list without touching the original data. Keep both columns until you have compared them.
Reshape Columns and Rows
CSV files often need structural edits rather than text cleanup. These are built into the menus.
- Split text to columns: select a column, then use
DataandSplit text to columnsto turn a combined field into separate fields. - Insert or delete: right-click a column or row header to add space or remove a field you do not need.
- Transpose: copy a range, then use
EditandPaste specialandTransposedto swap rows and columns. - Filter and sort: use
DataandCreate a filterto hide rows without deleting them, then sort the visible result.
Sorting changes row order, so keep a key column such as an identifier if you need to restore the original sequence later.
Export the Result Back to CSV
Choose File, Download and Comma-separated values. Google Sheets exports the active sheet only, so if you imported several files as tabs, export the one you cleaned.
Two details matter for the next system. A CSV export uses the comma as the separator unless your locale changes it, and dates export as displayed. Set the date format before exporting if the receiving system expects a fixed pattern.
If the destination expects a tab, choose Tab-separated values from the same menu. For a pipe or another delimiter, export to Excel first or use a small script, because the Sheets menu offers only comma-separated and tab-separated values and the other document formats.
An Optional Batch Clean with Apps Script
If the same cleanup repeats every month, a short Apps Script saves the manual pass. Open Extensions and Apps Script, paste the function below and run it once. It trims every text cell on the active sheet and collapses repeated spaces.
function trimAllText() {
const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getDataRange();
const values = range.getValues();
const formulas = range.getFormulas();
const cleaned = values.map(function (row) {
return row.map(function (cell) {
if (typeof cell !== "string") {
return cell;
}
return cell.trim().replace(/\s+/g, " ");
});
});
range.setValues(cleaned);
formulas.forEach(function (row, r) {
row.forEach(function (formula, c) {
if (formula !== "") {
sheet.getRange(r + 1, c + 1).setFormula(formula);
}
});
});
}
The function reads every formula first and writes it back after the trim, so numbers, dates and formulas keep their type. It is safe to run more than once because trimming a trimmed text value changes nothing. Add a confirmation step before running it on a sheet you cannot restore from version history.
This is the point where scripts start to earn their keep, and also the point where a non-technical teammate can no longer maintain the process. Flookup moves the same cleanup into a menu with a preview, which keeps the workflow usable by the whole team.
When the Sheet Is Not Enough
Google Sheets is a capable free CSV editor, but it has three hard boundaries.
- Size: a spreadsheet is capped at 10 million cells, so a multi-million row export can exceed the limit before you start.
- Exact matching: duplicate removal and lookups compare strings. A spelling variant, a different word order or an abbreviation is treated as a different value.
- Repetition: formulas and scripts have to be rebuilt or rerun for every new file, with no schedule and no audit trail beyond version history.
When a file is too large for the sheet, split it before the upload and clean the parts in turn. When the problem is near-duplicates rather than size, the fix is fuzzy matching.
Free CSV Editing and Where Flookup Fits
Google Sheets covers the free part of CSV editing well. Importing, trimming, deduplicating and exporting cost nothing, and the functions are familiar to anyone who has used a spreadsheet.
What the sheet cannot do is decide that "Acme Corp" and "Acme Corporation" are the same record, score how close two names are or reconcile a list against a master file at scale. That is what Flookup Data Wrangler adds inside Google Sheets, with fuzzy, phonetic and semantic matching and a similarity score on every row. The data cleaning tools show the full range, and the documentation lets you test every result before you buy.
Frequently Asked Questions
Can I edit a CSV file in Google Sheets for free?
Yes. Google Sheets imports, edits and exports CSV files at no cost. Open the file with File and Import, edit it like any sheet, then download it again as CSV.
How do I open a CSV without splitting the columns wrongly?
Use File and Import and select comma as the separator. Sheets usually detects it automatically. If a whole row lands in one cell, import the file again and set the separator yourself.
Does Google Sheets remove duplicate rows?
Yes. Data cleanup and Remove duplicates delete identical rows and report how many were removed. The match is exact, so trim stray spaces before you run it.
Can Google Sheets open a very large CSV file?
Sheets caps a spreadsheet at 10 million cells, so a multi-million row CSV can exceed the limit. Split the file first and import the parts, because the sheet cannot hold the whole file.
What if I need fuzzy matching rather than a simple edit?
Google Sheets has no fuzzy matching. Flookup Data Wrangler adds fuzzy, phonetic and semantic matching inside the same sheet, with a similarity score for every match.