Stupid question maybe but I've been looking at this for some time now and tried several things but somehow I cannot come up with a solution.

I have an HTML file that contains some variables at specific locations in a table. I need to read the file line by line and replace the variable with the actual value. There can be more than one variable on one line so I put in a while loop so it processes all variables. Somehow I cannot wrap my brain around it and can't get it to work. I had it once but then some people decided that they wanted my laptop and it was ok to steal it (just before I was planning to make a backup ) and it was gone.

It might be something simple but I need a push in the right direction.
 Code:
$rc = Open(1, "d:\oldfile.html", 2)
$rc = Open(2, "d:\newfile.html", 5)
$line = ReadLine(1)
While @ERROR = 0
	If InStr($line, "$")
		While InStr($line, "$")
			;translate any var in string to actual value
		Loop
		$rc = WriteLine(2, $line + @CRLF)
	Else
		$rc = WriteLine(2, $line + @CRLF)
	EndIf
	$line = ReadLine(1)
Loop
$rc = Close(1)
$rc = Close(2)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.