title: Add a column to any position in a file in unix [using awk or sed]
body: <p>I'm looking for other alternatives/more intelligent 1 liner for following command, which should add a value to a requested column number.
  I tried following following sed command works properly for adding value 4 to the 4th column.
  [Need: As i have such file which contains 1000 records &amp; many times i need to add a column in between at any position.]
  My approch is sutaible for smaller scale only.</p>
  
  <p><code>cat 1.txt</code></p>
  
  <pre><code>1|2|3|5
  1|2|3|5
  1|2|3|5
  1|2|3|5
  </code></pre>
  
  <p><code>sed -i 's/1|2|3|/1|2|3|4|/g' 1.txt</code></p>
  
  <p><code>cat 1.txt</code></p>
  
  <pre><code>1|2|3|4|5
  1|2|3|4|5
  1|2|3|4|5
  1|2|3|4|5
  </code></pre>
  
  <p>thansk in advance.</p>