Notifications
Clear all

[Closed] Reading from a .txt file

Hi,

I’m very confused about reading external txt files. Help is very poor about this, and I just don’t understand how this works. Is there any function to just call and try to read a simple, one line txt?

I’ve been trying this:

data_file = @"c:	emp\my_file.txt"
openFile data_file

and unfortunately nothing. I’ve tried readLine, readChar, readChars, … and I get errors or undefined. writing files is much less complicated

I think I don’t understand how this works. In help it says that it need to be operated on fileStreams. I guess this is a fileStream @“c: emp\my_file.txt” – astring that represents the path to the file?

How do I make it to work to read my file?

1 Reply
1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

openfile returns filestream value. it’s a source to get everything

data_file = @"c:	emp\my_file.txt"
ss = openFile data_file
str = readline ss
format ">>> %
" str
close ss