#33026 - 2002-11-21 01:07 PM
Re: Using a list.txt to hit remote machines
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
Les, I have to disagree about the parsing of txt files, it is not as hard as you make it sound
here is a UDF that I made and use in a number of scripts.
code:
function LoadFile($file) ;this function will load the contents of a text file into an array ;you can use a ";" in the test file for commenting and those lines will ;not be loaded dim $nul, $count dim $temp[5]
$nul = open(1,$file) while not @error $temp[$count] = readline(1) if substr($temp[$count],1,1) <> ";" and $temp[$count] <> "" $count = $count+1 endif if $count > ubound($temp) redim preserve $temp[ubound($temp)+10] endif loop if $count > 0 redim preserve $temp[$count - 1] else $temp = "" endif $loadfile = $temp $ = close(1) endfunction
INI files are good, but the limitations can be a show stopper.
But to load a flat text file, yes will require more code vs a INI file, but you gain much added control/flexibility for a very small price.
|
|
Top
|
|
|
|
#33032 - 2002-11-21 10:22 PM
Re: Using a list.txt to hit remote machines
|
ArchAngel96
Getting the hang of it
Registered: 2002-10-20
Posts: 70
|
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 302 anonymous users online.
|
|
|