frawk
frawk copied to clipboard
Split string into constant number of substrings
Today, frawk supports awk-style splits that populate an array with all of the relevant sub-strings in an (optional) separator. It would be both more succinct and more efficient to support syntax like:
a, b = splitstr("hi:there", ":")
Or similar. Where, the behavior of splitstr compiles down to something like splitn
with n
given by the number of variables on the left-hand side of the assignment.
This would be particularly helpful when unpacking map keys that are punctuated by SUBSEP
.