I have strings with delimited fields, but a different number of fields in each, eg:
- this/that
- this/that/theother
- this/that/theother/stuff
I want to retrieve the last two fields in each case, ie:
- this/that
- that/theother
- theother/stuff
This is easy in MySQL with the substring_index function, and I see this thread explains how to do it in PHP.
Can someone help me achieve the same with awk in the command line? Thanks
1 Answer