Sujet : Re: "sed" question
De : gtaylor (at) *nospam* tnetconsulting.net (Grant Taylor)
Groupes : comp.lang.awkDate : 08. Mar 2024, 16:12:05
Autres entêtes
Organisation : TNet Consulting
Message-ID : <usf9s5$ldr$1@tncsrv09.home.tnetconsulting.net>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla Thunderbird
On 3/8/24 08:46, Janis Papanagnou wrote:
Awk without regexps makes little sense;
I think this comes down to what is a regular expression and what is not a regular expression.
mind that the basic syntax of Awk programs is described as
pattern { action }
I'm guessing that 40-60% of the awk that I use doesn't use what I would consider to be regular expressions.
(NF == 5){print $3}
(NF == 8){print $4}
Or:
{total+=$5}
END{print total}
I usually think of regular expressions when I'm doing a sub(/re/, ...) type thing or a (... ~ /re/) type conditional. More specifically things between the // in both of those statements are the REs.
Maybe I have an imprecise understanding / definition.
-- Grant. . . .