Numerically sort clipboard contents

The amount of pages in a manual is rarely an indicator of the power or the usefulness of a tool :wink:
Awk shines when it comes to structured data, or better: data that can be structured. Recognizing fields in an record and then attemptimg to work with the fields (which includes the separators) is always better than treating the separators as mere strings and brute-forcely replacing them via regex. I think.

But, I think, you can achieve the same with Perl without regexes (i.e. only by manipulating separators). Beyond my current Perl knowledge :wink:

Concerning the gawk on macOS, I’m not sure. Most likely macOS has just awk, who knows which version. Have to look it up. I got a related problem here.


Edit:

No, gawk, as expected, comes only when installed via Homebrew or similar. But I don’t know the differences between gawk and awk, and I don’t know if awk/gawk scripts tend to use only the specific implementation (gawk or awk) or if they generously default to the one that is installed. (I have no practice with awk scripting.)

1 Like