Awk To Get The Last Elemet After a Delimiter
- May 28th, 2020
- Posted in Documentation
- Write comment
I have to write these things, so I can find them when I inevitably need them again.
This will give you the last element in a delimited string:
awk -F “:” ‘{print $NF}’
Here is an example:
$ echo “elemet1:element2:element3:element4” | awk -F “:” ‘{print $NF}’
element4
No comments yet.