Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search and replace
Message
 
 
À
23/01/2004 08:34:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00869816
Message ID:
00869850
Vues:
11
Claudio,

Your code replaces text 'xxx' not word 'xxx'.

>>I need to replace the word xxx for yyy for every file contained in a directory tree. What can I do? There are hundreds of words.
>>
>>TIA,
>
>Hi Pablo;
>
>On the following procedure you must only have care about files with some "danger" extension (as .EXE for instance)
>
>
>cwpath              = "\\machine\c\myfolder\mysub"
>cwoldtext           = "xxx"
>cwnewtext           = "yyy"
>Set defa to (cwpath)
>nwtotalfiles        = 0
>Dimension awFiles[1]
>nwtotalfiles        = ADIR(awFiles,"*.*")
>For ix = 1 TO nwtotalfiles
>    cwbuff        = filetostr(awFiles[ix,1])
>    do  while cwoldtext $ cwbuff
>        if  at(cwoldtext, cwbuff) > 0
>            cwbuff     = stuff(cwbuff, at(cwoldtext, cwbuff), len(cwoldtext), cwnewtext)
>        endif
>    Enddo
>    =strtofile(cwbuff, awFiles[ix,1])
>Endfor
>
>
>HTH
>
>Claudio
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform