Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
to replace the text in the file of a notepad
#4
Macro Macro2840
Code:
Copy      Help
str G1="9,800"
str G2="9,500"
str filePath="Q:\test\test.txt"
str fileText.getfile(filePath)

str oldText=
F
;1=
;{G1}
;2=
;{G2}

str newText=
F
;Bom {G1} bibom
;Mango {G2} tango

int n=fileText.findreplace(oldText newText 2) ;;see also replacerx
out F"Replaced {n} instances"

if(n) fileText.setfile(filePath)


Messages In This Thread

Forum Jump:


Users browsing this thread: 14 Guest(s)