Staaarter

CSV Column Replacer

Overwrites every data-row value in a chosen column (by index or header name) with either one constant value or a newline-separated list applied one value per row, optionally renaming the header too. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-29
By Staaarter Team
columnstructuraledit

Overview

Introduction

Bulk-editing a whole column, resetting a status field, filling in a placeholder, applying a corrected list of values, usually means a spreadsheet formula or a script. This tool does it directly on pasted CSV text.

It supports both the simple case (one value everywhere) and the more targeted case (a specific value per row, supplied as a plain list).

What Is CSV Column Replacer?

A structural CSV tool that overwrites every data-row cell in one chosen column, by index or header name, with either a repeated constant or a per-row list of replacement values.

An optional rename field lets the header cell be updated in the same pass, so a full column relabel-and-refill can happen in one step.

How CSV Column Replacer Works

The input is parsed and padded to a uniform grid, then the target column is resolved from your index or header-name reference.

In constant mode, the same value is written into every data row's cell in that column. In list mode, the newline-separated input is split into lines and matched one-to-one against data rows, erroring out if the counts don't match.

When To Use CSV Column Replacer

Use it when a whole column needs to be reset to one value, a default status, a blank placeholder, without touching any other column.

Use list mode when you already have a corrected or computed list of values, one per row, and need to drop it into an existing column in place.

Features

Advantages

  • Supports both a one-value-everywhere shortcut and a precise per-row list, in the same tool.
  • Validates that a per-row list's length exactly matches the data row count, preventing silent misalignment.
  • Can rename the header at the same time as replacing values, saving a second pass.

Limitations

  • List mode requires an exact line-count match with the data rows; there's no automatic padding or truncation of a mismatched list.
  • Only one column can be replaced per run.

Examples

Replacing a column with a per-row list

Input

id,status
1,pending
2,pending

Output

id,status
1,approved
2,rejected

With list mode and the replacement list "approved\nrejected", each data row gets the corresponding line from the list, in order.

Best Practices & Notes

Best Practices

  • Use constant mode for resets and defaults, and list mode only when you have a precomputed value for every single row.
  • Count your data rows before pasting a replacement list in list mode, to avoid a count-mismatch error.
  • Rename the header in the same pass if the new values represent a conceptually different field than before.

Developer Notes

List mode splits on `\n` and strips a trailing `\r` per line to tolerate CRLF-pasted lists, then requires `replacements.length === dataRowCount` exactly before writing anything, so a bad paste fails loudly rather than silently misaligning rows.

CSV Column Replacer Use Cases

  • Resetting a status or flag column to a single default value across every row
  • Dropping in a precomputed or corrected list of values for an existing column
  • Relabeling and refilling a column's header and data in one pass

Common Mistakes

  • Pasting a replacement list with an extra blank trailing line, which throws off the expected line count.
  • Forgetting that list mode applies values strictly in row order, not matched by any key or lookup.

Tips

  • If the line count doesn't match, paste your list into a plain text tool first to confirm the exact number of non-empty lines.
  • Leave the new header name blank to keep the existing header when you only want to change data, not labeling.

References

Frequently Asked Questions