How read the text lines from txt file?
- Juan Carlos
- Posts: 933
- Joined: Mon Sep 06, 2010 1:02 pm
How read the text lines from txt file?
I have this little question but a big problem for me, How read text lines from txt file? I open the file and insert as items every text line?
Re: How read the text lines from txt file?
Well, you could use ReadLine().
You could also process your text file using FileToString() and then SplitStr() with "\n" as your token$.
You could also process your text file using FileToString() and then SplitStr() with "\n" as your token$.
- Juan Carlos
- Posts: 933
- Joined: Mon Sep 06, 2010 1:02 pm
Re: How read the text lines from txt file?
Any easy and single example to open the txt file?
Re: How read the text lines from txt file?
The Hollywood documentation has a lot of good example code, such as this:
Code: Select all
OpenFile(1, "S:Startup-Sequence")
While Not Eof(1) Do NPrint(ReadLine(1))
CloseFile(1)- Juan Carlos
- Posts: 933
- Joined: Mon Sep 06, 2010 1:02 pm
Re: How read the text lines from txt file?
Thanks although I want read every line and put inside of variable to use every line of text, and I don't know as to do this, read the end every line and put in one Text$ variable and read the end of txt file.PEB wrote:The Hollywood documentation has a lot of good example code, such as this:Code: Select all
OpenFile(1, "S:Startup-Sequence") While Not Eof(1) Do NPrint(ReadLine(1)) CloseFile(1)
Re: How read the text lines from txt file?
I might not be understanding what you want to do, but I think you want to put each line into a table. If that is the case, then you can modify the sample code to something like this:
Code: Select all
TempTable$={}
OpenFile(1, "S:Startup-Sequence")
While Not Eof(1) Do InsertItem(TempTable$, ReadLine(1))
CloseFile(1)- Juan Carlos
- Posts: 933
- Joined: Mon Sep 06, 2010 1:02 pm
Re: How read the text lines from txt file?
Thanks, I need this, because I have problems with the translations for V.A.M.P. some special letters with editors and with the compiled change them, and the alternative is open the translation file, and get line to line and to put in the text message variable.PEB wrote:I might not be understanding what you want to do, but I think you want to put each line into a table. If that is the case, then you can modify the sample code to something like this:Code: Select all
TempTable$={} OpenFile(1, "S:Startup-Sequence") While Not Eof(1) Do InsertItem(TempTable$, ReadLine(1)) CloseFile(1)