Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
'Line is too long' when importing from file of type SDF
Message
De
16/07/1999 10:40:12
Jeroen Naus
Harte-Hanks Europe
Hasselt, Belgique
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00241824
Message ID:
00242304
Vues:
24
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
Fil
Voir

Click here to load this message in the networking platform