Hi,
So ... is there a way to use the XYplorer awsomeness to batch tru files containing match strings ... replacing the strings?
t
batch string replace in files
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Re: batch string replace in files
Hi and welcome to the XY forums!
I'm not sure if I fully understood what you wanted to do...could you better describe it so that we can give the appropriate answer? Because there are a wide variety of combinations that your initial statement could apply to, and which have differnt solutions.
I'm not sure if I fully understood what you wanted to do...could you better describe it so that we can give the appropriate answer? Because there are a wide variety of combinations that your initial statement could apply to, and which have differnt solutions.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
Quad Master
- Posts: 32
- Joined: 15 Sep 2008 07:28
Re: batch string replace in files
tjholleran wrote:Hi,
So ... is there a way to use the XYplorer awsomeness to batch tru files containing match strings ... replacing the strings?
t
I am assuming that you want to replace a particular word in a list of files with some other word.
eg.
test1
test2
test3
test4
and you want to replace "test" with "hello" like this
hello1
hello2
hello3
hello4
This is my script.
Code: Select all
"What To Replace - With This"
input $what,"What To Replace In The Selected Enteries", What;
input $with,"Replace With This", With This;
rename s, "$what/$with",p;Also check out the XYWiki its loaded with information on scripting.
Blog : Quad Tek Using : XYplorer v7.60.0000, 09-Sep-2008
Quick Learning XY Newbie
[ My Wishlist | XYRoadMap | XYWiki ]
Quick Learning XY Newbie
-
tjholleran
- Posts: 3
- Joined: 23 Sep 2008 00:58
Re: batch string replace in files
Sorry, I was not clear enough.
I can see that renaming the files is str8 forward.
I want to search for all files containing a string in the contents of the file ... not the file name ... and then replace that string in all the files and just resave the files.
Hope that makes more sense,
Thanks,
T
I can see that renaming the files is str8 forward.
I want to search for all files containing a string in the contents of the file ... not the file name ... and then replace that string in all the files and just resave the files.
Hope that makes more sense,
Thanks,
T
-
admin
- Site Admin
- Posts: 65188
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: batch string replace in files
Nope, not yet possible. But quite soon it will be easy using scripting. Just wait for commands ReadFile, WriteFile and Looping statements.tjholleran wrote:Sorry, I was not clear enough.
I can see that renaming the files is str8 forward.
I want to search for all files containing a string in the contents of the file ... not the file name ... and then replace that string in all the files and just resave the files.
Hope that makes more sense,
Thanks,
T
FAQ | XY News RSS | XY X
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: batch string replace in files
But if its a ini file then you can do this already using scripting. If not then like Don (admin) said wait for new commands.admin wrote:Nope, not yet possible. But quite soon it will be easy using scripting. Just wait for commands ReadFile, WriteFile and Looping statements.tjholleran wrote:Sorry, I was not clear enough.
I can see that renaming the files is str8 forward.
I want to search for all files containing a string in the contents of the file ... not the file name ... and then replace that string in all the files and just resave the files.
Hope that makes more sense,
Thanks,
T
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Re: batch string replace in files
FYI: We're not limited to 140 chars here so we can spell out words in many cases, like "straight", ok?tjholleran wrote:I can see that renaming the files is str8 forward.
I want to search for all files containing a string in the contents of the file ... not the file name ... and then replace that string in all the files and just resave the files.
And for your situation...I might recommend, for now, a freeware pgm whose author site seems to have vanished but I've used it for a couple of years...it was able to replace some things that other pgms couldn't...not sure if it's applicable to your case, but take a look, ok?
http://www.snapfiles.com/get/bkreplace.html
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
tjholleran
- Posts: 3
- Joined: 23 Sep 2008 00:58
Re: batch string replace in files
Thank you all for the feedback.
T
T
XYplorer Beta Club