<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://phyc-wiki.chem.oregonstate.edu/index.php?action=history&amp;feed=atom&amp;title=AWK</id>
	<title>AWK - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://phyc-wiki.chem.oregonstate.edu/index.php?action=history&amp;feed=atom&amp;title=AWK"/>
	<link rel="alternate" type="text/html" href="https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;action=history"/>
	<updated>2026-04-14T15:45:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;diff=101&amp;oldid=prev</id>
		<title>Tjmustard: /* Handy One Liners */</title>
		<link rel="alternate" type="text/html" href="https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;diff=101&amp;oldid=prev"/>
		<updated>2014-05-13T17:42:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Handy One Liners&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 17:42, 13 May 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l24&quot; &gt;Line 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-----&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Handy One Liners===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Handy One Liners===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;nowiki&lt;/del&gt;&amp;gt;HANDY ONE-LINERS FOR AWK                                  22 July 2003&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HANDY ONE-LINERS FOR AWK                                  22 July 2003&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;compiled by Eric Pement &amp;lt;pemente@northpark.edu&amp;gt;           version 0.22&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;compiled by Eric Pement &amp;lt;pemente@northpark.edu&amp;gt;           version 0.22&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    Latest version of this file is usually at:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    Latest version of this file is usually at:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l305&quot; &gt;Line 305:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 306:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All versions of awk, even the UNIX System 7 version should recognize&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All versions of awk, even the UNIX System 7 version should recognize&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the '\t' abbreviation.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the '\t' abbreviation.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;nowiki&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tjmustard</name></author>
		
	</entry>
	<entry>
		<id>https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;diff=99&amp;oldid=prev</id>
		<title>Tjmustard at 17:40, 13 May 2014</title>
		<link rel="alternate" type="text/html" href="https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;diff=99&amp;oldid=prev"/>
		<updated>2014-05-13T17:40:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 17:40, 13 May 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# do basic math&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# do basic math&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Grabing &lt;/del&gt;a substring==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Grabbing &lt;/ins&gt;a substring==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #echo &amp;quot;This is a large string.&amp;quot;|awk '{print $1}'&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #echo &amp;quot;This is a large string.&amp;quot;|awk '{print $1}'&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  This&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  This&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l10&quot; &gt;Line 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #echo &amp;quot;This is a large string.&amp;quot;|awk '{print $4}'&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #echo &amp;quot;This is a large string.&amp;quot;|awk '{print $4}'&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  large&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  large&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==Basic Math==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; #count=5&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; #echo $count|awk '{print $1 + 1}'&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; 6&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; #energy=-1283.5795938&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; #echo $energy|awk '{print $1/4.184}'&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; -306.782885707&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-----&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Handy One Liners===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Handy One Liners===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HANDY ONE-LINERS FOR AWK                                  22 July 2003&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;nowiki&amp;gt;&lt;/ins&gt;HANDY ONE-LINERS FOR AWK                                  22 July 2003&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;compiled by Eric Pement &amp;lt;pemente@northpark.edu&amp;gt;           version 0.22&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;compiled by Eric Pement &amp;lt;pemente@northpark.edu&amp;gt;           version 0.22&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    Latest version of this file is usually at:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    Latest version of this file is usually at:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l294&quot; &gt;Line 294:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 305:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All versions of awk, even the UNIX System 7 version should recognize&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All versions of awk, even the UNIX System 7 version should recognize&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the '\t' abbreviation.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the '\t' abbreviation.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tjmustard</name></author>
		
	</entry>
	<entry>
		<id>https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;diff=98&amp;oldid=prev</id>
		<title>Tjmustard at 17:37, 13 May 2014</title>
		<link rel="alternate" type="text/html" href="https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;diff=98&amp;oldid=prev"/>
		<updated>2014-05-13T17:37:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 17:37, 13 May 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l11&quot; &gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  large&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  large&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-----&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Handy One Liners===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Handy One Liners===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HANDY ONE-LINERS FOR AWK                                  22 July 2003&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HANDY ONE-LINERS FOR AWK                                  22 July 2003&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tjmustard</name></author>
		
	</entry>
	<entry>
		<id>https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;diff=97&amp;oldid=prev</id>
		<title>Tjmustard at 17:37, 13 May 2014</title>
		<link rel="alternate" type="text/html" href="https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;diff=97&amp;oldid=prev"/>
		<updated>2014-05-13T17:37:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 17:37, 13 May 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot; &gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Grabing a substring==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Grabing a substring==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; #echo &amp;quot;This is a large string.&amp;quot;|awk '{print $1}'&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; This&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; #echo &amp;quot;This is a large string.&amp;quot;|awk '{print $4}'&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; large&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Handy One Liners===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Handy One Liners===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tjmustard</name></author>
		
	</entry>
	<entry>
		<id>https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;diff=95&amp;oldid=prev</id>
		<title>Tjmustard: Created page with &quot;===General use:=== AWK can be used to: # grab a specific substring from a larger string # do basic math  ==Grabing a substring==   ===Handy One Liners=== HANDY ONE-LINERS FOR ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://phyc-wiki.chem.oregonstate.edu/index.php?title=AWK&amp;diff=95&amp;oldid=prev"/>
		<updated>2014-05-13T17:35:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;===General use:=== AWK can be used to: # grab a specific substring from a larger string # do basic math  ==Grabing a substring==   ===Handy One Liners=== HANDY ONE-LINERS FOR ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;===General use:===&lt;br /&gt;
AWK can be used to:&lt;br /&gt;
# grab a specific substring from a larger string&lt;br /&gt;
# do basic math&lt;br /&gt;
&lt;br /&gt;
==Grabing a substring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Handy One Liners===&lt;br /&gt;
HANDY ONE-LINERS FOR AWK                                  22 July 2003&lt;br /&gt;
compiled by Eric Pement &amp;lt;pemente@northpark.edu&amp;gt;           version 0.22&lt;br /&gt;
   Latest version of this file is usually at:&lt;br /&gt;
   http://www.student.northpark.edu/pemente/awk/awk1line.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
USAGE:&lt;br /&gt;
&lt;br /&gt;
    Unix:  awk '/pattern/ {print &amp;quot;$1&amp;quot;}'    # standard Unix shells&lt;br /&gt;
 DOS/Win:  awk '/pattern/ {print &amp;quot;$1&amp;quot;}'    # okay for DJGPP compiled&lt;br /&gt;
           awk &amp;quot;/pattern/ {print \&amp;quot;$1\&amp;quot;}&amp;quot;  # required for Mingw32&lt;br /&gt;
&lt;br /&gt;
Most of my experience comes from version of GNU awk (gawk) compiled for&lt;br /&gt;
Win32. Note in particular that DJGPP compilations permit the awk script&lt;br /&gt;
to follow Unix quoting syntax '/like/ {&amp;quot;this&amp;quot;}'. However, the user must&lt;br /&gt;
know that single quotes under DOS/Windows do not protect the redirection&lt;br /&gt;
arrows (&amp;lt;, &amp;gt;) nor do they protect pipes (|). Both are special symbols&lt;br /&gt;
for the DOS/CMD command shell and their special meaning is ignored only&lt;br /&gt;
if they are placed within &amp;quot;double quotes.&amp;quot; Likewise, DOS/Win users must&lt;br /&gt;
remember that the percent sign (%) is used to mark DOS/Win environment&lt;br /&gt;
variables, so it must be doubled (%%) to yield a single percent sign&lt;br /&gt;
visible to awk.&lt;br /&gt;
&lt;br /&gt;
If I am sure that a script will NOT need to be quoted in Unix, DOS, or&lt;br /&gt;
CMD, then I normally omit the quote marks. If an example is peculiar to&lt;br /&gt;
GNU awk, the command 'gawk' will be used. Please notify me if you find&lt;br /&gt;
errors or new commands to add to this list (total length under 65&lt;br /&gt;
characters). I usually try to put the shortest script first.&lt;br /&gt;
&lt;br /&gt;
FILE SPACING:&lt;br /&gt;
&lt;br /&gt;
 # double space a file&lt;br /&gt;
 awk '1;{print &amp;quot;&amp;quot;}'&lt;br /&gt;
 awk 'BEGIN{ORS=&amp;quot;\n\n&amp;quot;};1'&lt;br /&gt;
&lt;br /&gt;
 # double space a file which already has blank lines in it. Output file&lt;br /&gt;
 # should contain no more than one blank line between lines of text.&lt;br /&gt;
 # NOTE: On Unix systems, DOS lines which have only CRLF (\r\n) are&lt;br /&gt;
 # often treated as non-blank, and thus 'NF' alone will return TRUE.&lt;br /&gt;
 awk 'NF{print $0 &amp;quot;\n&amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
 # triple space a file&lt;br /&gt;
 awk '1;{print &amp;quot;\n&amp;quot;}'&lt;br /&gt;
&lt;br /&gt;
NUMBERING AND CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
 # precede each line by its line number FOR THAT FILE (left alignment).&lt;br /&gt;
 # Using a tab (\t) instead of space will preserve margins.&lt;br /&gt;
 awk '{print FNR &amp;quot;\t&amp;quot; $0}' files*&lt;br /&gt;
&lt;br /&gt;
 # precede each line by its line number FOR ALL FILES TOGETHER, with tab.&lt;br /&gt;
 awk '{print NR &amp;quot;\t&amp;quot; $0}' files*&lt;br /&gt;
&lt;br /&gt;
 # number each line of a file (number on left, right-aligned)&lt;br /&gt;
 # Double the percent signs if typing from the DOS command prompt.&lt;br /&gt;
 awk '{printf(&amp;quot;%5d : %s\n&amp;quot;, NR,$0)}'&lt;br /&gt;
&lt;br /&gt;
 # number each line of file, but only print numbers if line is not blank&lt;br /&gt;
 # Remember caveats about Unix treatment of \r (mentioned above)&lt;br /&gt;
 awk 'NF{$0=++a &amp;quot; :&amp;quot; $0};{print}'&lt;br /&gt;
 awk '{print (NF? ++a &amp;quot; :&amp;quot; :&amp;quot;&amp;quot;) $0}'&lt;br /&gt;
&lt;br /&gt;
 # count lines (emulates &amp;quot;wc -l&amp;quot;)&lt;br /&gt;
 awk 'END{print NR}'&lt;br /&gt;
&lt;br /&gt;
 # print the sums of the fields of every line&lt;br /&gt;
 awk '{s=0; for (i=1; i&amp;lt;=NF; i++) s=s+$i; print s}'&lt;br /&gt;
&lt;br /&gt;
 # add all fields in all lines and print the sum&lt;br /&gt;
 awk '{for (i=1; i&amp;lt;=NF; i++) s=s+$i}; END{print s}'&lt;br /&gt;
&lt;br /&gt;
 # print every line after replacing each field with its absolute value&lt;br /&gt;
 awk '{for (i=1; i&amp;lt;=NF; i++) if ($i &amp;lt; 0) $i = -$i; print }'&lt;br /&gt;
 awk '{for (i=1; i&amp;lt;=NF; i++) $i = ($i &amp;lt; 0) ? -$i : $i; print }'&lt;br /&gt;
&lt;br /&gt;
 # print the total number of fields (&amp;quot;words&amp;quot;) in all lines&lt;br /&gt;
 awk '{ total = total + NF }; END {print total}' file&lt;br /&gt;
&lt;br /&gt;
 # print the total number of lines that contain &amp;quot;Beth&amp;quot;&lt;br /&gt;
 awk '/Beth/{n++}; END {print n+0}' file&lt;br /&gt;
&lt;br /&gt;
 # print the largest first field and the line that contains it&lt;br /&gt;
 # Intended for finding the longest string in field #1&lt;br /&gt;
 awk '$1 &amp;gt; max {max=$1; maxline=$0}; END{ print max, maxline}'&lt;br /&gt;
&lt;br /&gt;
 # print the number of fields in each line, followed by the line&lt;br /&gt;
 awk '{ print NF &amp;quot;:&amp;quot; $0 } '&lt;br /&gt;
&lt;br /&gt;
 # print the last field of each line&lt;br /&gt;
 awk '{ print $NF }'&lt;br /&gt;
&lt;br /&gt;
 # print the last field of the last line&lt;br /&gt;
 awk '{ field = $NF }; END{ print field }'&lt;br /&gt;
&lt;br /&gt;
 # print every line with more than 4 fields&lt;br /&gt;
 awk 'NF &amp;gt; 4'&lt;br /&gt;
&lt;br /&gt;
 # print every line where the value of the last field is &amp;gt; 4&lt;br /&gt;
 awk '$NF &amp;gt; 4'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TEXT CONVERSION AND SUBSTITUTION:&lt;br /&gt;
&lt;br /&gt;
 # IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format&lt;br /&gt;
 awk '{sub(/\r$/,&amp;quot;&amp;quot;);print}'   # assumes EACH line ends with Ctrl-M&lt;br /&gt;
&lt;br /&gt;
 # IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format&lt;br /&gt;
 awk '{sub(/$/,&amp;quot;\r&amp;quot;);print}&lt;br /&gt;
&lt;br /&gt;
 # IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format&lt;br /&gt;
 awk 1&lt;br /&gt;
&lt;br /&gt;
 # IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format&lt;br /&gt;
 # Cannot be done with DOS versions of awk, other than gawk:&lt;br /&gt;
 gawk -v BINMODE=&amp;quot;w&amp;quot; '1' infile &amp;gt;outfile&lt;br /&gt;
&lt;br /&gt;
 # Use &amp;quot;tr&amp;quot; instead.&lt;br /&gt;
 tr -d \r &amp;lt;infile &amp;gt;outfile            # GNU tr version 1.22 or higher&lt;br /&gt;
&lt;br /&gt;
 # delete leading whitespace (spaces, tabs) from front of each line&lt;br /&gt;
 # aligns all text flush left&lt;br /&gt;
 awk '{sub(/^[ \t]+/, &amp;quot;&amp;quot;); print}'&lt;br /&gt;
&lt;br /&gt;
 # delete trailing whitespace (spaces, tabs) from end of each line&lt;br /&gt;
 awk '{sub(/[ \t]+$/, &amp;quot;&amp;quot;);print}'&lt;br /&gt;
&lt;br /&gt;
 # delete BOTH leading and trailing whitespace from each line&lt;br /&gt;
 awk '{gsub(/^[ \t]+|[ \t]+$/,&amp;quot;&amp;quot;);print}'&lt;br /&gt;
 awk '{$1=$1;print}'           # also removes extra space between fields&lt;br /&gt;
&lt;br /&gt;
 # insert 5 blank spaces at beginning of each line (make page offset)&lt;br /&gt;
 awk '{sub(/^/, &amp;quot;     &amp;quot;);print}'&lt;br /&gt;
&lt;br /&gt;
 # align all text flush right on a 79-column width&lt;br /&gt;
 awk '{printf &amp;quot;%79s\n&amp;quot;, $0}' file*&lt;br /&gt;
&lt;br /&gt;
 # center all text on a 79-character width&lt;br /&gt;
 awk '{l=length();s=int((79-l)/2); printf &amp;quot;%&amp;quot;(s+l)&amp;quot;s\n&amp;quot;,$0}' file*&lt;br /&gt;
&lt;br /&gt;
 # substitute (find and replace) &amp;quot;foo&amp;quot; with &amp;quot;bar&amp;quot; on each line&lt;br /&gt;
 awk '{sub(/foo/,&amp;quot;bar&amp;quot;);print}'           # replaces only 1st instance&lt;br /&gt;
 gawk '{$0=gensub(/foo/,&amp;quot;bar&amp;quot;,4);print}'  # replaces only 4th instance&lt;br /&gt;
 awk '{gsub(/foo/,&amp;quot;bar&amp;quot;);print}'          # replaces ALL instances in a line&lt;br /&gt;
&lt;br /&gt;
 # substitute &amp;quot;foo&amp;quot; with &amp;quot;bar&amp;quot; ONLY for lines which contain &amp;quot;baz&amp;quot;&lt;br /&gt;
 awk '/baz/{gsub(/foo/, &amp;quot;bar&amp;quot;)};{print}'&lt;br /&gt;
&lt;br /&gt;
 # substitute &amp;quot;foo&amp;quot; with &amp;quot;bar&amp;quot; EXCEPT for lines which contain &amp;quot;baz&amp;quot;&lt;br /&gt;
 awk '!/baz/{gsub(/foo/, &amp;quot;bar&amp;quot;)};{print}'&lt;br /&gt;
&lt;br /&gt;
 # change &amp;quot;scarlet&amp;quot; or &amp;quot;ruby&amp;quot; or &amp;quot;puce&amp;quot; to &amp;quot;red&amp;quot;&lt;br /&gt;
 awk '{gsub(/scarlet|ruby|puce/, &amp;quot;red&amp;quot;); print}'&lt;br /&gt;
&lt;br /&gt;
 # reverse order of lines (emulates &amp;quot;tac&amp;quot;)&lt;br /&gt;
 awk '{a[i++]=$0} END {for (j=i-1; j&amp;gt;=0;) print a[j--] }' file*&lt;br /&gt;
&lt;br /&gt;
 # if a line ends with a backslash, append the next line to it&lt;br /&gt;
 # (fails if there are multiple lines ending with backslash...)&lt;br /&gt;
 awk '/\\$/ {sub(/\\$/,&amp;quot;&amp;quot;); getline t; print $0 t; next}; 1' file*&lt;br /&gt;
&lt;br /&gt;
 # print and sort the login names of all users&lt;br /&gt;
 awk -F &amp;quot;:&amp;quot; '{ print $1 | &amp;quot;sort&amp;quot; }' /etc/passwd&lt;br /&gt;
&lt;br /&gt;
 # print the first 2 fields, in opposite order, of every line&lt;br /&gt;
 awk '{print $2, $1}' file&lt;br /&gt;
&lt;br /&gt;
 # switch the first 2 fields of every line&lt;br /&gt;
 awk '{temp = $1; $1 = $2; $2 = temp}' file&lt;br /&gt;
&lt;br /&gt;
 # print every line, deleting the second field of that line&lt;br /&gt;
 awk '{ $2 = &amp;quot;&amp;quot;; print }'&lt;br /&gt;
&lt;br /&gt;
 # print in reverse order the fields of every line&lt;br /&gt;
 awk '{for (i=NF; i&amp;gt;0; i--) printf(&amp;quot;%s &amp;quot;,i);printf (&amp;quot;\n&amp;quot;)}' file&lt;br /&gt;
&lt;br /&gt;
 # remove duplicate, consecutive lines (emulates &amp;quot;uniq&amp;quot;)&lt;br /&gt;
 awk 'a !~ $0; {a=$0}'&lt;br /&gt;
&lt;br /&gt;
 # remove duplicate, nonconsecutive lines&lt;br /&gt;
 awk '! a[$0]++'                     # most concise script&lt;br /&gt;
 awk '!($0 in a) {a[$0];print}'      # most efficient script&lt;br /&gt;
&lt;br /&gt;
 # concatenate every 5 lines of input, using a comma separator&lt;br /&gt;
 # between fields&lt;br /&gt;
 awk 'ORS=%NR%5?&amp;quot;,&amp;quot;:&amp;quot;\n&amp;quot;' file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECTIVE PRINTING OF CERTAIN LINES:&lt;br /&gt;
&lt;br /&gt;
 # print first 10 lines of file (emulates behavior of &amp;quot;head&amp;quot;)&lt;br /&gt;
 awk 'NR &amp;lt; 11'&lt;br /&gt;
&lt;br /&gt;
 # print first line of file (emulates &amp;quot;head -1&amp;quot;)&lt;br /&gt;
 awk 'NR&amp;gt;1{exit};1'&lt;br /&gt;
&lt;br /&gt;
  # print the last 2 lines of a file (emulates &amp;quot;tail -2&amp;quot;)&lt;br /&gt;
 awk '{y=x &amp;quot;\n&amp;quot; $0; x=$0};END{print y}'&lt;br /&gt;
&lt;br /&gt;
 # print the last line of a file (emulates &amp;quot;tail -1&amp;quot;)&lt;br /&gt;
 awk 'END{print}'&lt;br /&gt;
&lt;br /&gt;
 # print only lines which match regular expression (emulates &amp;quot;grep&amp;quot;)&lt;br /&gt;
 awk '/regex/'&lt;br /&gt;
&lt;br /&gt;
 # print only lines which do NOT match regex (emulates &amp;quot;grep -v&amp;quot;)&lt;br /&gt;
 awk '!/regex/'&lt;br /&gt;
&lt;br /&gt;
 # print the line immediately before a regex, but not the line&lt;br /&gt;
 # containing the regex&lt;br /&gt;
 awk '/regex/{print x};{x=$0}'&lt;br /&gt;
 awk '/regex/{print (x==&amp;quot;&amp;quot; ? &amp;quot;match on line 1&amp;quot; : x)};{x=$0}'&lt;br /&gt;
&lt;br /&gt;
 # print the line immediately after a regex, but not the line&lt;br /&gt;
 # containing the regex&lt;br /&gt;
 awk '/regex/{getline;print}'&lt;br /&gt;
&lt;br /&gt;
 # grep for AAA and BBB and CCC (in any order)&lt;br /&gt;
 awk '/AAA/; /BBB/; /CCC/'&lt;br /&gt;
&lt;br /&gt;
 # grep for AAA and BBB and CCC (in that order)&lt;br /&gt;
 awk '/AAA.*BBB.*CCC/'&lt;br /&gt;
&lt;br /&gt;
 # print only lines of 65 characters or longer&lt;br /&gt;
 awk 'length &amp;gt; 64'&lt;br /&gt;
&lt;br /&gt;
 # print only lines of less than 65 characters&lt;br /&gt;
 awk 'length &amp;lt; 64'&lt;br /&gt;
&lt;br /&gt;
 # print section of file from regular expression to end of file&lt;br /&gt;
 awk '/regex/,0'&lt;br /&gt;
 awk '/regex/,EOF'&lt;br /&gt;
&lt;br /&gt;
 # print section of file based on line numbers (lines 8-12, inclusive)&lt;br /&gt;
 awk 'NR==8,NR==12'&lt;br /&gt;
&lt;br /&gt;
 # print line number 52&lt;br /&gt;
 awk 'NR==52'&lt;br /&gt;
 awk 'NR==52 {print;exit}'          # more efficient on large files&lt;br /&gt;
&lt;br /&gt;
 # print section of file between two regular expressions (inclusive)&lt;br /&gt;
 awk '/Iowa/,/Montana/'             # case sensitive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECTIVE DELETION OF CERTAIN LINES:&lt;br /&gt;
&lt;br /&gt;
 # delete ALL blank lines from a file (same as &amp;quot;grep '.' &amp;quot;)&lt;br /&gt;
 awk NF&lt;br /&gt;
 awk '/./'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CREDITS AND THANKS:&lt;br /&gt;
&lt;br /&gt;
Special thanks to Peter S. Tillier for helping me with the first release&lt;br /&gt;
of this FAQ file.&lt;br /&gt;
&lt;br /&gt;
For additional syntax instructions, including the way to apply editing&lt;br /&gt;
commands from a disk file instead of the command line, consult:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;sed &amp;amp; awk, 2nd Edition,&amp;quot; by Dale Dougherty and Arnold Robbins&lt;br /&gt;
  O'Reilly, 1997&lt;br /&gt;
&amp;quot;UNIX Text Processing,&amp;quot; by Dale Dougherty and Tim O'Reilly&lt;br /&gt;
  Hayden Books, 1987&lt;br /&gt;
&amp;quot;Effective awk Programming, 3rd Edition.&amp;quot; by Arnold Robbins&lt;br /&gt;
  O'Reilly, 2001&lt;br /&gt;
&lt;br /&gt;
To fully exploit the power of awk, one must understand &amp;quot;regular&lt;br /&gt;
expressions.&amp;quot; For detailed discussion of regular expressions, see&lt;br /&gt;
&amp;quot;Mastering Regular Expressions, 2d edition&amp;quot; by Jeffrey Friedl&lt;br /&gt;
   (O'Reilly, 2002).&lt;br /&gt;
&lt;br /&gt;
The manual (&amp;quot;man&amp;quot;) pages on Unix systems may be helpful (try &amp;quot;man awk&amp;quot;,&lt;br /&gt;
&amp;quot;man nawk&amp;quot;, &amp;quot;man regexp&amp;quot;, or the section on regular expressions in &amp;quot;man&lt;br /&gt;
ed&amp;quot;), but man pages are notoriously difficult. They are not written to&lt;br /&gt;
teach awk use or regexps to first-time users, but as a reference text&lt;br /&gt;
for those already acquainted with these tools.&lt;br /&gt;
&lt;br /&gt;
USE OF '\t' IN awk SCRIPTS: For clarity in documentation, we have used&lt;br /&gt;
the expression '\t' to indicate a tab character (0x09) in the scripts.&lt;br /&gt;
All versions of awk, even the UNIX System 7 version should recognize&lt;br /&gt;
the '\t' abbreviation.&lt;/div&gt;</summary>
		<author><name>Tjmustard</name></author>
		
	</entry>
</feed>