Jump to content

Ruriko

Member
  • Posts

    6
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Australia

About Ruriko

Profile Information

  • OS
    Windows 7 x86

Ruriko's Achievements

0

Reputation

  1. It's not the same but it's similar. The code isn't exactly the same just a bit more code added with more steps. The other thread reads 2 txt file while this one is reading 4 txt files
  2. I am having trouble of making the vbscript to read the text line by line. This is the steps the code should do: Read folder.txt Open the file listed in folder.txt Echo the contents inside of test.txt Read folder-list.txt Open the file listed in folder-list.txt Open dirlist.txt and echo line by line An example of what folder.txt contains: 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 An example of what folder-list.txt contains: 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 An example of what each dirlist.txt contains 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 And this is the vbscript 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 So far I only got steps 1 to 4 working but I can't get it to read dirlist.txt. Any solutions here?
  3. I have a list full of directories and I want to loop through those directories and open the txt file. Then read the data inside that txt file and assign to a variable. This is an example of the directory list looks like: 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 C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Abo Manten] Kyuusho seme maniacs vol. 3 (Weak Spot Maniacs vol.3) [521993]\test.txt C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Afro] Futanari angel cg collection [521560]\test.txt C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Aim-ZERO] Case Vol.4 [519927]\test.txt C:\Documents and Settings\Administrator\Desktop\ArtistCG\[Air Hike] ________CG_2 [525114]\test.txt Now here's the code Option Explicit Dim objFSO, strTextFile, strData, strLine, arrLines CONST ForReading = 1 'name of the text file strTextFile = "C:\Documents and Settings\Administrator\Desktop\ArtistCG\folders.txt" 'Create a File System Object Set objFSO = CreateObject("Scripting.FileSystemObject") 'Open the text file - strData now contains the whole file strData = objFSO.OpenTextFile(strTextFile,ForReading).ReadAll 'Split the text file into lines arrLines = Split(strData,vbCrLf) 'Step through the lines For Each strLine in arrLines wscript.echo strLine Next 'Cleanup Set objFSO = Nothing Now the problem with the code is it reads the contents of folders.txt instead of going to the directory and read the test.txt file. Can anyone help me fix this?
  4. How do I refresh the image if it fails to load in vbscript?
  5. Hi I'm a newbie at vbscript and I was wondering how do I extract the iframe name? like for example if the string value contains: <DIV style="MARGIN-TOP: 0px; WIDTH: 670px; HEIGHT: 210px; VISIBILITY: visible; MARGIN-LEFT: -335px; TOP: 48px" id=TB_window><DIV id=TB_title> <DIV id=TB_ajaxWindowTitle>Add Media</DIV> <DIV id=TB_closeAjaxWindow><A id=TB_closeWindowButton title=Close href="#" jQuery172014112867239284427="140"><IMG src="http://www.gorgeoushentai.com/wp-includes/js/thickbox/tb-close.png"></A></DIV></DIV><IFRAME style="WIDTH: 670px; HEIGHT: 180px" id=TB_iframeContent onload=tb_showIframe() src="http://www.gorgeoushentai.com/wp-admin/media-upload.php?post_id=168&" frameBorder=0 name=TB_iframeContent656 hspace=0>This feature requires inline frames. You have iframes disabled or your browser does not support them.</IFRAME></DIV> then the extracted name would be TB_iframeContent656
×
×
  • Create New...