How to extract a substring of $0, in awk, when that substring's position and length is based on the positions of fields in the original $0?
It effectively equates to removing the first n.lead fields and the last n.trail fields and all those fields' leading and trailing delimiters, from the original $0
Here is an example: It is only known that the range is $4 to $8 inclusive.
The delimiter is any number of spaces and/or a single comma, eg. " , " or just ","... and the leading delimiter is to be ignored.
Input: " a a a X marks the start, Y marks the end "
Expected Output: "X marks the start, Y"
