Skip to content

nfmt

nfmt, a newline formatting utility, standardizes line endings and spacing in text files.

Usage

nfmt [OPTIONS] [INPUT_FILE]

Options

-s, --spacing INTEGER  Number of newlines between paragraphs (default: 1)
-o, --output PATH     Output file (default: stdout)

Examples

Basic Usage

# Format with single newline spacing
nfmt input.txt > formatted.txt

# Format with double spacing
nfmt -s 2 input.txt > formatted.txt

# Process from stdin
cat input.txt | nfmt > formatted.txt

Common Use Cases

  • Standardizing line endings before processing
  • Preparing text for pattern-based processing
  • Cleaning up transcribed text