C
C#12mo ago
Ewan

✅ How do i read the next line in a text file

So i have a text file with like 5 different lines. When i read it, it only outputs the first line, how do i swap to the next line and then the next ect?
11 Replies
SinFluxx
SinFluxx12mo ago
How are you doing it so far?
Ewan
EwanOP12mo ago
No description
Ewan
EwanOP12mo ago
im doing it like this however it just reads the first line i dont want it to read all the lines at once but to output each line in the file individually
SinFluxx
SinFluxx12mo ago
How would you normally repeat an action with code?
Ewan
EwanOP12mo ago
uhh not sure? i just wanna know how to swap lines because i can only read the first line
SinFluxx
SinFluxx12mo ago
Well ReadLine() will read the next line (as it has done in your code), so you just need a way to keep asking for the next line, a loop of some sort perhaps?
Ewan
EwanOP12mo ago
does RealLine() read every new line??
SinFluxx
SinFluxx12mo ago
it reads the next line from where the reader currently is
Ewan
EwanOP12mo ago
oh!! i didnt know using ReadLine multiple times goes onto the next line
SinFluxx
SinFluxx12mo ago
If you hover pretty much any symbol in your ide it will give you information on what it does/how it works:
No description
Ewan
EwanOP12mo ago
ooo ok thank you!!!
Want results from more Discord servers?
Add your server