I’m curious if it is possible to retrieve not only the isolated fields using awk, but also a part of the original string that contains multiple adjacent fields and the enclosed delimiters?
For example, when using awk on
foo.bar.baz.test
with the '.' delimiter, and telling awk to extract the fields 2 and 3, I want to be able to retrieve
bar.baz
automatically. I know I can re-construct the part of the string later by hand, but that just does not feel right.
Ideas?
I am not very sure if this is what you want :
EDIT
see the test below: