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.
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