Jump to content
Sign in to follow this  

Pulling data from text file

Recommended Posts


I am trying to write a script that will make about 2000 different batch files. I have a bunch of video files that I want to have a batch file linked to it so it can just open up in VLC. I have all of the file names already typed out in a text file and I need the script to write "START C:\Progra~1\VideoLAN\VLC\vlc.exe -vvv -f "X:\Movies\***MOVIE NAME FROM LIST HERE***" and then just save it as "MOVIE NAME.bat". I am new to scripting and am stuck on how to pull the data from the text file I have or how to save it as the name of the file with a .bat extension. Here is what I have so far, I'm pretty sure i need to add some sort of variable but I'm not sure:



Send("START C:\Progra~1\VideoLAN\VLC\vlc.exe -vvv -f "X:\Movies\")

;send movie name here





;save as .bat file here


Any help would be amazing and greatly appreciated. Thanks =]

Share this post

Link to post
Share on other sites

I'm feeling generous today ... XMas spirit :evil:

Here you go:

#include <File.au3>

Global $MyFile = "your file full path and name here"
Global $myArray
_FileReadToArray($MyFile, $myArray)         ;read all the lines in an array

For $i = 1 To $myArray[0]
    FileOpen("X:\Movies\"&$myArray[$i]&".bat", 2)       ;create *.bat file
    FileWrite("X:\Movies\"&$myArray[$i]&".bat", 'START C:\Progra~1\VideoLAN\VLC\vlc.exe -vvv -f ""X:\Movies\'&$myArray[$i]&'""')

MsgBox(0, "Job Done", "Successfully created "&$myArray[0]&" batch files.")

You better try the script with a shorter file (just a couple titles) just to see how it works; after that you can use the big file.

Merry XMas ;)

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post

Link to post
Share on other sites

Oh man I love you haha it worked perfectly thank you!!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this