You can append the entire file into a memo field of a temporary cursor. Do some strtran()'s on the weird characters. Save it back out and try to import it.
Following prg changes a text file from one codepage to another. You can do something similar but instead of using cpconvert do a strtran.
parameter p_filename,p_origcp,p_newcp
*
* Program to cpconvert a file
*
IF PARAMETERS() = 1
p_origcp = 437
p_newcp = 1252
ENDIF
m.tmparea = select()
CREATE cursor pg_temp (final M(10))
SELE pg_temp
APPEND blank
APPEND memo final from alltr(p_filename)
replace final with cpconvert(p_origcp,p_newcp,pg_temp.final)
m.tmpsafe = set("safety")
SET SAFETY OFF
copy memo final to (p_filename)
IF ALLTR(UPPER(m.tmpsafe)) = "ON"
SET SAFETY ON
ELSE
SET SAFETY OFF
ENDIF
use in pg_temp
SELECT(m.tmparea)
return .t.
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