Anuraag
2nd November 2004, 08:54
Hi !
I have a script in which I wish to read some values from the txt file lying at the client side for which I am using seq.read.local() function. The record length is varying and not fixed. The problem occurs when I read the value from file to a string variable of 255 chr, the data being read includes the next line also if the line being read is less than 255 char. Is there any way to read the line upto the end of line irrespective of it's length. The script I am using is as below for reference:

string data(255)
filename = "c:\scandata"
ret = EXEC_DLL_FUNCTION ("ottdllbw", "seq.open.local", fp, filename, "r", 2)
while not (seq.eof(fp)) = 0
EXEC_DLL_FUNCTION ("ottdllbw", "seq.read.local", ret, data, 225, fp)
if ret <> 0 then
break
endif
.....
.....
.....
endwhile

vahdani
2nd November 2004, 12:50
Hallo,

I personally would copy the file to a temp-file on the server using "client2server" function and then read this file with the well behaved function "seq.gets". :rolleyes:

mark_h
2nd November 2004, 15:43
I recommend the same as vahdani - at least that is how I handle it. But you could always write your own parser to build your buffer. Just read it one character at a time building a buffer. When you hit a carriage return(or maybe CR/LF) then you buffer is full and you can process the data. Then start reading again until you hit the next carriage return. At least I think this would work.

Mark

Anuraag
8th November 2004, 07:10
Thanks vahdani & mark_h for the valuable suggestions. I got the work around by using seq.gets() as the pcs here are shared. Hence, reading the file from the client site by specifying the complete network path.

Thanks

Davendra