DonationCoder.com Software > Post New Requests Here
Script for replace any substring in a text file accodring a csv data file
Contro:
I think a script of this must exist....
A good string to search in Saint google ?
:-*
Contro:
In my case i think is simpler. I need only one parameter.
A good script for this ?
Loop, Read
FileAppend, % A_LoopReadLine, % SubStr("00" A_Index, -2) ".script.iim"
return
:-[
kyrathaba:
Can you give me an example of two or three strings and then the contents of a CSV file and how you'd want to apply those contents toward extraction/replacement of substrings?
If you can give me some real world examples, I might be able to tackle this for you, OP.
Target:
In my case i think is simpler. I need only one parameter.
-Contro (May 04, 2015, 08:28 AM)
--- End quote ---
simpler than that...
this is (untested) in AHK...
--- ---
inputbox, srch, Search String ; get a search string
inputbox, rep, Replacement string ;get a replacement string
fileselectfile, tmp_,,,Select a file, CSV(*.csv) ; select a csv file
fileread, tmp_2, %tmp_% ; read in to a variable
stringreplace, %tmp_2%, tmp_2, %srch%, %rep%, all ; replace all occurrences of the srch string with the rep string
fileappend, %tmp_2%, %tmp_%.csv ; write out to a new file
exitapp
Navigation
[0] Message Index
[*] Previous page
Go to full version