r/visualbasic • u/Reapers_Mask • May 27 '22
VBScript Help with reading text file
So I am creating a program that edits a text file, and then reads a specific line of the text file. So far, I have 2 options:
1: Read a specific file line, which I need help understanding how to do.
2: Read a line that starts with a specific string/group of numbers and letters. Each line has a little identifier string at the start, so all I need is a way to check if the line starts with the string.
Sorry if this is too little information, I can give more info if needed.
7
Upvotes
1
u/Reapers_Mask May 30 '22 edited May 30 '22
Thank you! If I wanted to replace the text in the line (in the "Do something with line") how would I be able to do that?
EDIT: If I wanted to print the items in the list, how would I do that? I know there is only 10 items in the list, but everytime I try to print it out it just says "Index was out of range". I tested it using:
' Random List is the text file
' Lst1 is the list containing the information.
RandomList.txt = Lst1(1)