vb.net - Find and replace text in a text file -


i creating program finds specific sentence in word path , replaces given value.

specific sentence: l="600"

and has changed : l="300"

this not difficult , works fine:

public class form1  private property sign string  private sub button1_click(sender object, e eventargs) handles button1.click  dim sign1 string dim sign2 string   sign1 = ("""600""") 'original value sign2 = ("""300""") 'new value  dim source string = "c:\temp\bodem.mpr" 'path original file dim destination string = "c:\temp\bodem2.mpr" 'path new file dim oldtext string = "l=" & sign1 'old value dim newtext string = "l=" & sign2 'new value  my.computer.filesystem.writealltext(destination, my.computer.filesystem.readalltext (source).replace(oldtext, newtext), false) process.start("c:\temp\bodem2.mpr") 'opens program in wordpath control value end sub   end class 

the problem original sentence : l="600" not have value 600, instead has different value don't know. (example : l="600" / l="600.02" / l="300" / l="1600.02") how can write down in code.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -