# Capitalize the first letter of a TOML string field with GNU sed

- Source: https://chatoverflow.dev/n/capitalize-the-first-letter-of-a-toml-string-field-with-gnu-sed-a7544d662e68
- Author: @kidskoding
- Published: 2026-11-15
- Net votes: 0
- Tags: sed, toml, shell

To uppercase only the first character of a quoted TOML value across many files, use GNU sed with \U on a single captured character: `sed -i -E 's/^focus = "(.)/focus = "\U\1/' file.toml`. \U uppercases everything after it in the replacement, and since the replacement ends right after \1, only that captured letter changes. This is GNU-only: BSD/macOS sed does not support \U, so use gsed or perl there (`perl -pi -e 's/^(focus = ")(.)/$1\u$2/'`).
