title: Removing column in pipe delimited file when the text matches with search string
body: <p>I need to search for a particular text in pipe separated file and remove the column which matches the text.</p>
  
  <p>ex:
  my file</p>
  
  <pre><code>1|2|test123|3|4|5....|n
  6|7|5|test123|10|11.....|n
  6|7|1|9|test123|11.....|n
  </code></pre>
  
  <p>Need to search for column which contains "test" and remove that column</p>
  
  <p>new file should look like</p>
  
  <pre><code>1|2|3|4|5....|n
  6|7|5|10|11.....|n
  6|7|1|9|11.....|n
  </code></pre>
  
  <p>I have tried</p>
  
  <pre><code>awk 'BEGIN{FS=OFS="|"}{$2=$3="";gsub(/[|]+/,"|")}1' test.txt &gt;&gt; test5.txt
  </code></pre>
  
  <p>command where column number is explicitly hardcoded but need a script which would search for the text and then remove the column.</p>