title: Replacing a String Pattern with another sequence in unix
body: <p>I want replace the String <code>TaskID_1</code> with a sequence starting from <code>1001</code> and this <code>TaskID_1</code> can exists any many number of lines in my input file.
  Similarly i need to replace all occurrences of <code>TASKID_2</code> in my input file with next sequence value <code>1002</code>.</p>
  
  <p>Input file:</p>
  
  <pre><code>12345|45345|TaskID_1|dksj|kdjfdsjf|12
  1245|425345|TaskID_1|dksj|kdjfdsjf|12
  1234|25345|TaskID_2|dksj|kdjfdsjf|12
  123425|65345|TaskID_2|dksj|kdjfdsjf|12
  123425|15325|TaskID_1|dksj|kdjfdsjf|12
  11345|55315|TaskID_2|dksj|kdjfdsjf|12
  6345|15345|TaskID_3|dksj|kdjfdsjf|12
  72345|25345|TaskID_4|dksj|kdjfdsjf|12
  9345|411345|TaskID_3|dksj|kdjfdsjf|12
  </code></pre>
  
  <p>The output file should look like:</p>
  
  <pre><code>12345|45345|1001|dksj|kdjfdsjf|12
  1245|425345|1001|dksj|kdjfdsjf|12
  1234|25345|1002|dksj|kdjfdsjf|12
  123425|65345|1002|dksj|kdjfdsjf|12
  123425|15325|1001|dksj|kdjfdsjf|12
  11345|55315|1002|dksj|kdjfdsjf|12
  6345|15345|1003|dksj|kdjfdsjf|12
  72345|25345|1004|dksj|kdjfdsjf|12
  9345|411345|1003|dksj|kdjfdsjf|12
  </code></pre>