title: VBS split a comma delimited line in a textfile
body: <p>I am not a vbs scripting guy but need to solve a problem with a comma delimited line in a textfile that i would like to split up in separate files, i can split the line into multiple files but all the files ens up containing all split lines, so somehow i get it wrong.</p>
  
  <p>Current script is like this</p>
  
  <pre><code>Set fso = CreateObject("Scripting.FileSystemObject")
  set src = fso.OpenTextFile("c:\Temp\Read.txt",1)
  lines = split(src.readall, ",")
  
  for i = 1 to ubound(lines)
  set dst = fso.CreateTextFile( i &amp; ".txt", true)
  dst.writeline lines(0)
  dst.writeline lines(1)
  dst.writeline lines(2)
  dst.writeline lines(3)
  dst.writeline lines(4)
  dst.writeline lines(5)
  
  dst.close
  next
  </code></pre>
  
  <p>Read.txt looks like this.</p>
  
  <pre><code>c:\Folder1\.\\, D:\Folder1\.\\, D:\Folder2\.\\
  </code></pre>
  
  <p>The textline sometimes include one folder and sometimes it is 6 or 7 folders so the line contains any number from 1 to 10 commadelimited folderpaths. there is only one line in the file.</p>
  
  <p>i would like the output to be a new textfile for each split and that the space is removed to, as the ending ".\\" (remove last three characters)
  I know how to do parts of it in a separate vbs but have no clue how to include it in the same script as above., below is the ending output i would like to get.</p>
  
  <p>1.txt <em>containing</em></p>
  
  <pre><code>C:\Folder1\
  </code></pre>
  
  <p>2.txt <em>containing</em></p>
  
  <pre><code>D:\Folder1\
  </code></pre>
  
  <p>3.txt <em>containing</em> </p>
  
  <pre><code>D:\Folder2\
  </code></pre>
  
  <p>etc...</p>