{"id":284,"date":"2017-11-17T14:56:10","date_gmt":"2017-11-17T13:56:10","guid":{"rendered":"http:\/\/giveback.danielmenzel.de\/?p=284"},"modified":"2017-11-17T15:01:54","modified_gmt":"2017-11-17T14:01:54","slug":"awk-mit-einem-1-tabstopp","status":"publish","type":"post","link":"http:\/\/giveback.danielmenzel.de\/?p=284","title":{"rendered":"awk mit einem (1) Tabstopp"},"content":{"rendered":"<p>Mit awk kann man prima Tabellen verarbeiten. Ein Fallstrick sind Tabstopps als Delimiter\/Field Separator wenn es Felder gibt die mal gef\u00fcllt und mal nicht gef\u00fcllt sind.<!--more-->awk nimmt n\u00e4mlich mehrere Tabstopps dann als einen Separator und die Liste kommt durcheinander.<\/p>\n<p>Abhilfe: Klares definieren des &#8222;field separator&#8220;:<\/p>\n<pre>cat in.csv |\u00a0 awk 'BEGIN{FS=\"\\t\"}{print $5,$6 \";\" $2 \";\" $5 \";\" $6 \";\"}' &gt;out.txt<\/pre>\n<p>Hier wird nur ein (1) Tab als field separator genommen und die Liste bleibt so wie sie ist.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>(problem awk list table csv field separator seperator durcheinander scambled)<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mit awk kann man prima Tabellen verarbeiten. Ein Fallstrick sind Tabstopps als Delimiter\/Field Separator wenn es Felder gibt die mal gef\u00fcllt und mal nicht gef\u00fcllt sind.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,7],"tags":[],"class_list":["post-284","post","type-post","status-publish","format-standard","hentry","category-excel","category-linux"],"_links":{"self":[{"href":"http:\/\/giveback.danielmenzel.de\/index.php?rest_route=\/wp\/v2\/posts\/284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/giveback.danielmenzel.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/giveback.danielmenzel.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/giveback.danielmenzel.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/giveback.danielmenzel.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=284"}],"version-history":[{"count":3,"href":"http:\/\/giveback.danielmenzel.de\/index.php?rest_route=\/wp\/v2\/posts\/284\/revisions"}],"predecessor-version":[{"id":287,"href":"http:\/\/giveback.danielmenzel.de\/index.php?rest_route=\/wp\/v2\/posts\/284\/revisions\/287"}],"wp:attachment":[{"href":"http:\/\/giveback.danielmenzel.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/giveback.danielmenzel.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=284"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/giveback.danielmenzel.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}