Hi Chuck, as i read it, you want to read 1500 files (approx) with that exact same format and then for each file read write one new line with ; delimited.
if so, start with making a loop that opens up all of these files one by one (this all depends on where they are located an how the naming scheme is...)
before you enter the loop, make kix open (if necessary create) a file called output.csv, use something like :
if open (5, "$outputfile", 4) = 0
the 4 tells kix to create the file if it doesn't exist.
the in the loop, open a new loop reading all the lines and extracting some variable like :
While @error = 0
$line = Readline(5)
if $line <> "" (this checks for empty lines)
do something
endif
loop
then at the do something you should think of some way to extract the data you need into a variable, using string manipulations.
check the help file for the different functions you can use. (split, len, ltrim, rtrim etc etc)
If there is a variable length number of lines to be read you could also perform a loop with readlines first to determine the numer of lines and then use that number to define an array to catch them in.
as son as you get all the variables filled, perform a writeline in the outputfile like:
writeline(5, "$var1 + ";" + $var2 + ";" + .. etc")
you could start off (after the creation of the outputfile) with a line that defines all fields in a similar way.
the code would look like :
code:
break onif open (5, "$outputfile", 4) = 0
endif
if writeline (5, "Computername" + ";" + "cpuspeed" + ";" + etc)
;writes the line at the top of the file that explains the data..
endif
for each "file to read" ;think of something here to address all the files you want to read
While @error = 0
$line = readline (5)
IF $line <> ""
====================================
extract data from the $line variable
====================================
endif
loop
writeline(5, "$var1 + ";" + $var2 + ";" + .. etc")
next
if close(5) = 0
endif
exit
looking at your inputfile it is a shame that the software enbtries do not have a "=" sparating the description from the value, that way it would have been real easy to use a split on the read line usoing the "=" to split on and extracting the description and value in a similar way for each line. Maybe that can b changed ??
did that help ??
Ciao,
MvdW