Script for replace any substring in a text file accodring a csv data file
Replace or add substring to a text file according a csv file.
Best Regards

Replace or add substring to a text file according a csv file.
Best Regards


more detail needed, eg what criteria would you use to determine whether to add or replace
Despite its name, my tool Excel2Html can be used for this exercise, if the .csv file is converted (loaded) into a .xls or .xlsx file.
And a .html template is plain text, of course.
Relevant DC threads (original Coding snack request and support-thread) are available from the link.


In my case i think is simpler. I need only one parameter.
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
exitappOriginal address: https://www.donationcoder.com/forum/index.php?topic=40760.0