{"id":455,"date":"2019-10-08T17:22:49","date_gmt":"2019-10-09T00:22:49","guid":{"rendered":"http:\/\/gantovnik.com\/bio-tips\/?p=455"},"modified":"2020-01-15T11:07:27","modified_gmt":"2020-01-15T19:07:27","slug":"awk1","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2019\/10\/awk1\/","title":{"rendered":"awk1"},"content":{"rendered":"","protected":true},"excerpt":{"rendered":"","protected":true},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[18],"tags":[],"class_list":["post-455","post","type-post","status-publish","format-standard","post-password-required","hentry","category-awk"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s8bH0k-awk1","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":867,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/156-filtering-content-from-files-using-awk\/","url_meta":{"origin":455,"position":0},"title":"#156 Filtering content from files using awk","author":"gantovnik","date":"2021-02-09","format":false,"excerpt":"#156 Displaying and filtering the content of files with awk Using the following command, we can print all lines from the file: This is equivalent to using the $0 variable. The $0 variables refers to the complete line. If we want to print only the first field from the file,\u2026","rel":"","context":"In &quot;awk&quot;","block_context":{"text":"awk","link":"https:\/\/gantovnik.com\/bio-tips\/category\/awk\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":890,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/158-filtering-content-from-files-based-on-field-value-using-awk\/","url_meta":{"origin":455,"position":1},"title":"#158 Filtering content from files based on field value using awk","author":"gantovnik","date":"2021-02-09","format":false,"excerpt":"#158 Filtering content from files based on field value using awk Request to print lines which has value in field #3 larger than 999: Request to print lines which has value in field #3 smaller than 101:","rel":"","context":"In &quot;awk&quot;","block_context":{"text":"awk","link":"https:\/\/gantovnik.com\/bio-tips\/category\/awk\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":842,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/01\/148-print-lines-containing-words-bar-gap-quad-and-count-number-of-lines-in-each-group-using-awk\/","url_meta":{"origin":455,"position":2},"title":"#148 Print lines containing words &#8220;BAR&#8221;, &#8220;GAP&#8221;, &#8220;QUAD&#8221; and count number of lines in each group using awk","author":"gantovnik","date":"2021-01-15","format":false,"excerpt":"#148 Print lines containing words \"BAR\", \"GAP\", \"QUAD\" and count number of lines in each group using awk Save the following awk script in the file \"ex148.awk\" Run file \"ex148run.txt\" using The result is","rel":"","context":"In &quot;awk&quot;","block_context":{"text":"awk","link":"https:\/\/gantovnik.com\/bio-tips\/category\/awk\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":616,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/09\/94-average-of-values-of-a-column-using-awk\/","url_meta":{"origin":455,"position":3},"title":"#94 Average of  values of a column using awk","author":"gantovnik","date":"2020-09-09","format":false,"excerpt":"#94 Average of values of a column using awk command Assume we have \"test1.txt\" file with data in columns: Save the following awk script in the file \"ex94.awk\" Run file \"ex94run.txt\" using The result is","rel":"","context":"In &quot;awk&quot;","block_context":{"text":"awk","link":"https:\/\/gantovnik.com\/bio-tips\/category\/awk\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":886,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/157-formatting-output-in-awk\/","url_meta":{"origin":455,"position":4},"title":"#157 Formatting output in awk","author":"gantovnik","date":"2021-02-09","format":false,"excerpt":"#157 Formatting output in awk Without formatting, the command look like this The same command with formatting With the header information added to the BEGIN block:","rel":"","context":"In &quot;awk&quot;","block_context":{"text":"awk","link":"https:\/\/gantovnik.com\/bio-tips\/category\/awk\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":613,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/09\/93-summing-values-of-a-column-using-awk-command\/","url_meta":{"origin":455,"position":5},"title":"#93 Summing values of a column using awk","author":"gantovnik","date":"2020-09-09","format":false,"excerpt":"#93 Summing values of a column using awk command Assume we have \"test1.txt\" file with data in columns: Save the following awk script in the file \"ex93.txt\" Run this script The result is","rel":"","context":"In &quot;awk&quot;","block_context":{"text":"awk","link":"https:\/\/gantovnik.com\/bio-tips\/category\/awk\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=455"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/455\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}