mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2013
Posts: 7
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: May 2013
Posts: 7
Hello...

I want to read all the contents of a text file and then display those contents in a single line. Using the play command, it displays the contents of the file line by line... but I want to display the contents in a single line. How can I achieve this ?

Last edited by Dragneel; 17/06/13 03:23 PM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
This will only work for small files.

Code:
var %i = 1, %lines = $lines(%file), %text
while (%i <= %lines) {
  %text = %text $read(%file,%i)
  inc %i
}

Joined: May 2013
Posts: 7
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: May 2013
Posts: 7


Edit: Thanks for the reply laugh

Last edited by Dragneel; 17/06/13 04:26 PM.
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
It might be a good idea to use the 'n' flag in $read so that the contents of the file aren't evaluated.


Link Copied to Clipboard