Page 1 of 1 1
Topic Options
#29685 - 2002-09-26 11:18 AM Readline Query
N00NchieS Offline
Fresh Scripter

Registered: 2002-09-23
Posts: 7
Hey Guys,

I am pretty new to Kix, here`s my problem. I have a text file within which is a list of computer names on the network which i piped from net view, what i want to do with this is have ReadLine read each line one after another in some sort of loop so that it returns each line of text one after another from the textfile in order, just can`t seem to get my head round this one i`m afraid... doh any help is greatly appreciated ta!

Top
#29686 - 2002-09-26 11:40 AM Re: Readline Query
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
see these manual links:
open()
readline()

and once you get there (they are the same as in kixtart-manual) read them.

there is simple already made script just for what you are asking.

 
_________________________
!

download KiXnet

Top
#29687 - 2002-09-26 11:41 AM Re: Readline Query
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The example in the manual does exactly what you are asking for:
code:
IF Open(3, @LDRIVE + "\CONFIG\SETTINGS.INI")  = 0
$x = ReadLine(3)
WHILE @ERROR = 0
? "Line read: [" + $x + "]"
$x = ReadLine(3)
LOOP
Close (3)
ELSE
BEEP
? "Config file not opened, error code: [" + @ERROR + "]"
ENDIF

Or have I misunderstood your query?

Top
#29688 - 2002-09-26 11:42 AM Re: Readline Query
Schuliebug Offline
Hey THIS is FUN
*****

Registered: 2002-01-18
Posts: 379
Loc: Netherlands
It's in the manual:

code:
If Open(1,$file)=0
$Line=ReadLine(1)
$ReadError=@Error

While $ReadError=0
? $Line

$Line=ReadLine(1)
$ReadError=@ERROR
Loop

$=Close(1)
EndIf

Oops, too late [Wink]

[ 26. September 2002, 11:43: Message edited by: Schuliebug ]
_________________________
Kind regards,

Top
#29689 - 2002-09-26 11:43 AM Re: Readline Query
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
 

me fastest!

 
_________________________
!

download KiXnet

Top
#29690 - 2002-09-26 11:44 AM Re: Readline Query
Schuliebug Offline
Hey THIS is FUN
*****

Registered: 2002-01-18
Posts: 379
Loc: Netherlands
Lonkero's the greatest [Smile] [Smile]
_________________________
Kind regards,

Top
#29691 - 2002-09-26 11:56 AM Re: Readline Query
N00NchieS Offline
Fresh Scripter

Registered: 2002-09-23
Posts: 7
Hehe doh guess i`m just havin a bad day huh looked at that chm page like 20 times... simple case of RTFM ... oh well cheers for your help neways guyz ... N00NchieS = Oficially blind
Top
#29692 - 2002-09-27 12:12 AM Re: Readline Query
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
N00NchieS,
Don't worry. If you posted it in one of the other forums you might have got stomped on, but we're more gentle in Starters. The first time, anyway [Wink]

PS, Welcome to the board.

PPS, "N00NchieS" - crazy monicker!

Top
#29693 - 2002-09-27 12:25 AM Re: Readline Query
N00NchieS Offline
Fresh Scripter

Registered: 2002-09-23
Posts: 7
Cheers,

I knew i had prob done somethin stupid so thas y i posted it in the starters forum.. as i say today i feel like a bit of a badger... expect less silliness in future [Razz] ...END OF LINE...

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.037 seconds in which 0.014 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org