ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > Post New Requests Here

Script for replace any substring in a text file accodring a csv data file

<< < (2/2)

I think a script of this must exist....

A good string to search in Saint google ?


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"



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.

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



[0] Message Index

[*] Previous page

Go to full version