Hi all
I do not want to copy the file. I want to open file and replace a string on it and rewrite new content of the file.
for following example , MS Excel cannot open new file.
****************************
STORE FOPEN('Excel.xls') TO gnFileHandle && Open the file
STORE FSEEK(gnFileHandle, 0, 2) TO gnEnd && Move pointer to EOF
STORE FSEEK(gnFileHandle, 0) TO gnTop && Move pointer to BOF
IF gnEnd <= 0 && Is file empty?
WAIT WINDOW 'This file is empty!' NOWAIT
ELSE && If not
gcString = FGETS(gnFileHandle, gnEnd) && Store contents
gcString= STRTRAN(gcString,"original string", "new string")
gnIOBytes = FWRITE(gnFileHandle,' for low-level file I/O')
glFlushOk = FFLUSH(gnFileHandle)
glCloseOk = FCLOSE(gnFileHandle)
*******************************************
Regard
Canh
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only