title: How to preserve the original whitespace between fields in awk?
body: <p>When processing input with <code>awk</code>, sometimes I want to edit one of the fields, without touching anything else. Consider this:</p>
  
  <pre><code>$ ls -l | awk 1
  total 88
  -rw-r--r-- 1 jack jack     8 Jun 19  2013 qunit-1.11.0.css
  -rw-r--r-- 1 jack jack 56908 Jun 19  2013 qunit-1.11.0.js
  -rw-r--r-- 1 jack jack  4306 Dec 29 09:16 test1.html
  -rw-r--r-- 1 jack jack  5476 Dec  7 08:09 test1.js
  </code></pre>
  
  <p>If I don't edit any of the fields (<code>$1</code>, <code>$2</code>, ...), everything is preserved as it was. But if let's say I want to keep only the first 3 characters of the first field:</p>
  
  <pre><code>$ ls -l | awk '{$1 = substr($1, 1, 3) } 1'
  tot 88
  -rw 1 jack jack 8 Jun 19 2013 qunit-1.11.0.css
  -rw 1 jack jack 56908 Jun 19 2013 qunit-1.11.0.js
  -rw 1 jack jack 4306 Dec 29 09:16 test1.html
  -rw 1 jack jack 5476 Dec 7 08:09 test1.js
  </code></pre>
  
  <p>The original whitespace between all fields is replaced with a simple space.</p>
  
  <p>Is there a way to preserve the original whitespace between the fields?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>In this sample, it's relatively easy to edit the first 4 fields. But what if I want to keep only the 1st letter of <code>$5</code> in order to get this output:</p>
  
  <pre><code>-rw-r--r-- 1 jack jack     8 J 19  2013 qunit-1.11.0.css
  -rw-r--r-- 1 jack jack 56908 J 19  2013 qunit-1.11.0.js
  -rw-r--r-- 1 jack jack  4306 D 29 09:16 test1.html
  -rw-r--r-- 1 jack jack  5476 D  7 08:09 test1.js
  </code></pre>