Replace string with parent folder name
Posted: Mon Jan 31, 2022 9:12 pm
Hello!
TextCrawler has been the answer to so many of my problems, I'm proud to be a registered user.
Here's my question..
I'm trying to locate "<SampleName>SAMPLE" in multiple files and replace the word SAMPLE with the folder name that the file resides in.
Lets say the file is "C:\Anything\More\Trumpet\MyFile.xml"
I want to replace the text "<SampleName>SAMPLE" inside that file with "<SampleName>Trumpet"
Any ideas on how to accomplish this? I will be modifying a lot of different files in different folders. Thanks!
TextCrawler has been the answer to so many of my problems, I'm proud to be a registered user.
Here's my question..
I'm trying to locate "<SampleName>SAMPLE" in multiple files and replace the word SAMPLE with the folder name that the file resides in.
Lets say the file is "C:\Anything\More\Trumpet\MyFile.xml"
I want to replace the text "<SampleName>SAMPLE" inside that file with "<SampleName>Trumpet"
Any ideas on how to accomplish this? I will be modifying a lot of different files in different folders. Thanks!