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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement