I am having a problem reading a file. I have a file that I am trying to read and get it to search for a string in one of the lines. However, the READLINE seems to look at each individual character in the line and thus breaking up what I am looking for.

I have tried to rename the extension of the file to TXT, but I still have the same problem. The only way I can get it to work is to copy the contents of the file into notepad and then save it as a TXT file or if I save it with the same file extension as the original file. When I use either of these methods, the string I am looking for can be found. It does not work i I simply copy the file elsewhere and rename it directly.

I added the command
 Code:
 'Result of first ReadLine: ' @ERROR ' / ' @SERROR ?

which someone pointed out to me for another problem and I get the result of Result of first ReadLine: 0 / The operation completed successfully. for the first line that is read, but the last line that is read, comes out as
Result of first ReadLine: -1 / Error (317 / 13D) while retrieving error information for FFFFFFFF

This is the sample code I am using:
 Code:
BREAK ON
CLS
$nul=OPEN(1,"\\server_name\confreuters$\Config\Fichiers_XML\cfg_configuration_default.xml")
'Result of first ReadLine: ' @ERROR ' / ' @SERROR ?
$allow = READLINE(1)
WHILE @ERROR=0
	? $allow
	$allow = READLINE(1)
LOOP
'Result of first ReadLine: ' @ERROR ' / ' @SERROR ?
close(1)


Normally I wouldn't have the ? $allow in there, but I am using that just to see what is happening, my normal script would read as follows:

 Code:
BREAK ON
CLS
$nul=OPEN(1,"\\server_name\confreuters$\Config\Fichiers_XML\cfg_configuration_default.xml")
$allow = READLINE(1)
WHILE @ERROR=0
	IF iNSTR($allow,@WKSTA)
		GOTO PERMIT
	ELSE
	ENDIF
	$allow = READLINE(1)
LOOP

:PERMIT
do what you gotta do here
close(1)


For some reason in the file that is not read properly, the first thing it prints on my screen is a ÿ_ and I have no idea why or where it comes from.

Thanks in advance for any and all help.