string.Explode

So, I have a .txt file containing tonnes of lines, I need each line to be added to a table.
How would I do this?
Something like string.Explode("
", file.Read(“lol.txt”)) ?

EDIT:
Only the last line of the test shows, every other value is nil/blank/whatever.

EDIT2:
Okay, now im getting this error message


Browser Message: Uncaught SyntaxError: Unexpected token ILLEGAL - :0p

Show the code you’re using.

[lua]local SteamIDs = string.Explode("
", file.Read(“steamids.txt”))[/lua]

steamids.txt:


STEAM_0:0_X
STEAM_0:0_XX
STEAM_0:0_XXX

My guess would be the illegal characters ;p "
"

Is that file’s codepage ANSI as UTF-8 (UTF-8 w/o byte order mark)?

Isn’t there something on the wiki about steamids containing characters which cannot be written?

They cant be written as filenames afaik, they are fine in files.

It should work, look at what Noi said, you might want to rewrite it in just a plain notepad document and try it again.

I cried at what you said.
Please explain it in simpler form.

Your text editor’s weird.

What happens if you delete steamids.txt then try:
[lua]
file.Write( “steamids.txt”, “STEAM_0:0_X
STEAM_0:0_XX
STEAM_0:0_XXX” )
[/lua]

Then try and read it?

If it’s possible in your application, you’re probably best off saving IDs with commas separating them, so you can simply use the comma in the explode function. If you’re just trying to parse this file once, you could always open it in something like Notepad++ and replace all newlines (
with extended search mode) with commas, then run that with the method described above.

string.Explode should work fine with /n