Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Hi Al:
This is something i found on the Net to get rid of pesky squares (apologies to original author who i did not note). I expanded to replace all French accents with english equivalent characters as i was experiencing spelling problems reading from a french college document ito our english dept file. the bottom command is what you are looking for i believe.
k
cFile = Filetostr("C:\sample.txt") && Read file
For i = 0 To 32 && Loop through control characters
*IF INLIST(i,10,13) && Skip Line Feed and Carriage Return
*LOOP
*ENDIF
cFile = Strtran(cFile,Chr(34),"") && Replace " ntrol Characters with Empty
cFile = Strtran(cFile,Chr(61),"") && Replace = ntrol Characters with Empty
cFile = Strtran(cFile,Chr(150),"") && Replace - ntrol Characters with Empty
cFile = Strtran(cFile,Chr(61),"") && CONVERT fRENCH
cFile = Strtran(cFile,Chr(199),"C")
cFile = Strtran(cFile,Chr(200),"E")
cFile = Strtran(cFile,Chr(201),"E")
cFile = Strtran(cFile,Chr(202),"E")
cFile = Strtran(cFile,Chr(231),"c")
cFile = Strtran(cFile,Chr(232),"e")
cFile = Strtran(cFile,Chr(233),"e")
cFile = Strtran(cFile,Chr(219),"U")
cFile = Strtran(cFile,Chr(251),"u")
cFile = Strtran(cFile,Chr(212),"O")
cFile = Strtran(cFile,Chr(194),"A")
cFile = Strtran(cFile,Chr(206),"I")
**cFile = STRTRAN(cFile,CHR(i),"") && reokace variabe i (Integer character) with empty
Endfor
= Strtofile(cFile,"C:\clean.txt") && or Convert to csv file
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