Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Philogyny recapitulates erogeny; erogeny recapitulates philogyny.


devel / comp.lang.awk / numlines

SubjectAuthor
o numlinesMike Sanders

1
numlines

<uiup7j$13e73$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1744&group=comp.lang.awk#1744

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkchop@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: numlines
Date: Tue, 14 Nov 2023 03:23:32 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 39
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uiup7j$13e73$1@dont-email.me>
Injection-Date: Tue, 14 Nov 2023 03:23:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="998942b2f43746d9a81408a97e4223f2";
logging-data="1161443"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0VoL9EieX535bx9sFUOmL"
Keywords: Mike's Notes
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:Enw7y15FGchwIIR+dg4PVaq7EMg=
 by: Mike Sanders - Tue, 14 Nov 2023 03:23 UTC

FILE: example1.txt

001 Simple little script to number lines
002 (this block of text demonstrates its use).
003

FILE: example2.txt

001 Yes I know, there are other utilities that do the same,
002 but when in Rome, do as the Romans do...
003

# tags: numlines, lines, numbers, pad, awk, code
# # adds uniformly padded line numbers to output to a width
# of three zeros (999 max per file - adjust as needed)
# Michael Sanders 2023
# https://busybox.neocities.org/notes/numlines.txt
# # usage: awk -f numlines.txt FILE [FILE]
# # example output...
# # FILE: fubar.sh
# # 001 #!/bin/sh
# ...
# 999 exit $?

FNR == 1 { printf "\nFILE: %s\n\n", FILENAME }

{ printf "%03d %s\n", FNR, $0 }

# eof

--
:wq
Mike Sanders

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor