CLI Reference

csvsmith provides a command-line interface (CLI) for common CSV processing tasks.

All commands follow this general structure:

csvsmith <command> [options]

Available commands

The following subcommands are available:

Data transformation

  • clean-numeric — Normalize numeric values in text fields

  • clean-currency-numeric — Normalize currency-prefixed numeric values

  • dedupe — Remove duplicate rows

  • drop-rows — Filter rows based on conditions

File operations

  • excel-to-csv — Convert Excel files to CSV

  • move-files — Move or organize files based on rules

  • strict-concat — Concatenate CSV files with identical headers

Analysis

  • classify — Categorize or label data

  • find-matches — Search for matching records

See the Tools section for detailed usage of each command.

Quick examples

Convert Excel to CSV:

csvsmith excel-to-csv input.xlsx -o output.csv

Remove duplicates:

csvsmith dedupe data.csv -o clean.csv

Clean numeric fields:

csvsmith clean-numeric "1,200.50" --sep "," --decimal "."

Clean currency-prefixed numeric fields:

csvsmith clean-currency-numeric '$1,234.56'

Note

When using values starting with $ (e.g., "$1234.56") in the shell, be aware that the shell might attempt to expand it as a variable. Always use single quotes ('$1234.56') to prevent unexpected expansion.

Global options

Some options are shared across multiple commands:

  • -o, --output Specify output file or directory.

  • -h, --help Show help message for a command.

To see command-specific options:

csvsmith <command> --help

Command help

Each subcommand provides its own help message:

csvsmith clean-numeric --help

This will display:

  • available options

  • required arguments

  • usage examples

Notes

  • Commands are designed to be composable in scripts and pipelines.

  • Input files are not modified unless explicitly overwritten.