Skip to Content
gnux

-n, --number-format

Insert line numbers according to FORMAT (ln, rn or rz; default rn).

An option of nlx.

Usage

nlx -n FORMAT [FILE]...
nlx --number-format=FORMAT [FILE]...

Details

ShortLongValueDefaultMeaning
-n--number-formatFORMATinsert line numbers according to FORMAT (ln, rn or rz; default rn)

Examples

Give records fixed-width, zero-padded IDs

nlx -n rz -w 5 -s , names.txt > names.csv
Output
00001,Ada
00002,Grace
00003,Linus

Number lines left-aligned with no padding before the text

nlx -n ln -w 1 -s ' ' todo.txt

Help in the terminal

gnux help nlx --number-format

On this page