title: Windows batch file : Search line for keyword and edit using delimiters
body: <p>I am writing a batch file to edit a text file of cygwin to enable chroot without manual intervention.</p>
  
  <p>I want to find  the line which contain keyword <strong>SvcCOPSSH</strong> and then edit 
  line to replace number between third and forth using deliminator  colon "<strong>:</strong>"</p>
  
  <p>For example find below line</p>
  
  <blockquote>
    <p>SvcCOPSSH:unused_by_nt/2000/xp:<strong>1023</strong>:545:U-WINDOWS-AU90FH5\SvcCOPSSH,S-1-5-21-2xxxx5-2xxx9-7xx50-1031:/var/:/bin/false</p>
  </blockquote>
  
  <p>and edit <strong>1023</strong> to <strong>0</strong></p>
  
  <blockquote>
    <p>SvcCOPSSH:unused_by_nt/2000/xp:<strong>0</strong>:545:U-WINDOWS-AU90FH5\SvcCOPSSH,S-1-5-21-2xxxx5-2xxx9-7xx50-1031:/var/:/bin/false</p>
  </blockquote>
  
  <p>Thanks for your help</p>