title: how to delete the string before a certain char at dos?
body: <p>Suppose I have file name text.txt and contains several lines. Each line starts with dayname and finished with a "/" char then the path is added. I just need the file names on the other hand for each line not the path. Thus I need something to convert the file from this way:</p>
  
  <pre><code>mon/C:\stt\test_file.abc
  sat/C:\Documents and Settings\alguri\Desktop\test_file2.txt
  fri/C:\sat\new_folder2\file3.jpg
  </code></pre>
  
  <p>to</p>
  
  <pre><code>mon/test_file.abc
  sat/test_file2.txt
  fri/file3.jpg
  </code></pre>
  
  <p>I need this code at dos command. I tried some code but can not parse the string in different ways. Because path name can have more than one "\" char. </p>
  
  <p>For istance if I know that there is only two "\" chars in a line. I can do something like:</p>
  
  <pre><code>for /f "tokens=1,4 delims=/\" %%a in (text.txt) do (
  echo %%a
      )
  </code></pre>
  
  <p>This will give the right answer only for line 1 which is "test_file.abc"
  However all other lines have different number of "\" char. How do you think I can handle this?</p>
  
  <p>One solution in my mind is to count number of "\" and set the tokens second parameter to decide which part I need. But I could do that. Besides tokens value might not be set dynamically as I thought. </p>