{"id":1819,"date":"2020-05-28T14:11:51","date_gmt":"2020-05-28T21:11:51","guid":{"rendered":"https:\/\/jim-zimmerman.com\/?p=1819"},"modified":"2020-05-28T14:11:51","modified_gmt":"2020-05-28T21:11:51","slug":"awk-to-get-the-last-elemet-after-a-delimiter","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=1819","title":{"rendered":"Awk To Get The Last Elemet After a Delimiter"},"content":{"rendered":"<p>I have to write these things, so I can find them when I inevitably need them again.<\/p>\n<p>This will give you the last element in a delimited string:<\/p>\n<blockquote><p>awk -F &#8220;:&#8221; &#8216;{print $NF}&#8217;<\/p><\/blockquote>\n<p>Here is an example:<\/p>\n<blockquote><p>$ echo &#8220;elemet1:element2:element3:element4&#8221; | awk -F &#8220;:&#8221; &#8216;{print $NF}&#8217;<br \/>\nelement4<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;:&#8221; &#8216;{print $NF}&#8217; Here is an example: $ echo &#8220;elemet1:element2:element3:element4&#8221; | awk -F &#8220;:&#8221; &#8216;{print $NF}&#8217; element<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[337],"class_list":["post-1819","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-awk"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1819"}],"version-history":[{"count":1,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1819\/revisions"}],"predecessor-version":[{"id":1820,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1819\/revisions\/1820"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}