title: Read txt file line by line
body: <p>I am having trouble of making the vbscript to read the text line by line.
  This is the steps the code should do:</p>
  
  <ol>
  <li>Read folder.txt </li>
  <li>Open the file listed in folder.txt</li>
  <li>Echo the contents inside of test.txt</li>
  <li>Read folder-list.txt</li>
  <li>Open the file listed in folder-list.txt</li>
  <li>Open dirlist.txt and echo line by line</li>
  </ol>
  
  <p>An example of what folder.txt contains:</p>
  
  <pre><code>C:\Documents and Settings\Administrator\Desktop\ArtistCG\[ Go! Go! Heaven!!]_____________25 -______ ___- [525067]\test.txt
  C:\Documents and Settings\Administrator\Desktop\ArtistCG\[12CUT] _____ (Gakkou no Kaidan) [518382]\test.txt
  C:\Documents and Settings\Administrator\Desktop\ArtistCG\[2____] _____!__CD__________ [521206]\test.txt
  C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Ability] _____________________ [514182]\test.txt
  </code></pre>
  
  <p>An example of what folder-list.txt contains:</p>
  
  <pre><code>C:\Documents and Settings\Administrator\Desktop\ArtistCG\[ Go! Go! Heaven!!]_____________25 -______ ___- [525067]\dirlist.txt
  C:\Documents and Settings\Administrator\Desktop\ArtistCG\[12CUT] _____ (Gakkou no Kaidan) [518382]\dirlist.txt
  C:\Documents and Settings\Administrator\Desktop\ArtistCG\[2____] _____!__CD__________ [521206]\dirlist.txt
  C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Ability] _____________________ [514182]\dirlist.txt
  </code></pre>
  
  <p>An example of what each dirlist.txt contains</p>
  
  <pre><code>C:\Documents and Settings\Administrator\Desktop\ArtistCG\[ Go! Go! Heaven!!]_____________25 -______ ___- [525067]\00.jpg
  C:\Documents and Settings\Administrator\Desktop\ArtistCG\[ Go! Go! Heaven!!]_____________25 -______ ___- [525067]\a_01.jpg
  C:\Documents and Settings\Administrator\Desktop\ArtistCG\[ Go! Go! Heaven!!]_____________25 -______ ___- [525067]\a_02.jpg
  C:\Documents and Settings\Administrator\Desktop\ArtistCG\[ Go! Go! Heaven!!]_____________25 -______ ___- [525067]\a_03.jpg
  </code></pre>
  
  <p>And this is the vbscript code</p>
  
  <pre><code>Option Explicit
  
  Dim objFSO, strTextFile, strData, strLine, arrLines, aniTextFile, aniData, aniLines, meLine, objTextFile, fso, inputFileList, sFolderName, fname
  Dim iim1, iret, iret2, iret3, i
  CONST ForReading = 1
  
  strTextFile = "C:\Documents and Settings\Administrator\Desktop\ArtistCG\folder.txt"
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  strData = objFSO.OpenTextFile(strTextFile,ForReading).ReadAll
  arrLines = Split(strData,vbCrLf)
  
  For Each strLine in arrLines
    strData = objFSO.OpenTextFile(strLine,ForReading).ReadAll
  WScript.Echo strData
  
  aniTextFile = "C:\Documents and Settings\Administrator\Desktop\ArtistCG\folder-list.txt"
  
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  aniData = objFSO.OpenTextFile(aniTextFile,ForReading).ReadAll
  aniLines = Split(aniData,vbCrLf)
  
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set listFile = fso.OpenTextFile(aniLines).ReadAll
  do while not listFile.AtEndOfStream 
      fName =  listFile.ReadLine()
      WScript.Echo fName
      Loop
  Next
  </code></pre>
  
  <p>So far I only got steps 1 to 4 working but I can't get it to read dirlist.txt. Any solutions here?</p>