18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
replace string into same line
OS=Linux
Browser=firefox
i want to replace particular word with new value into same text file
My Text file like (test.txt)
Hello
How are u
now i want to replace "Hi " on the place of "Hello" in same file
i want out put like(test.txt)
Hi
How are u
In both case filename is same
Any idea
Thanks in advance
Browser=firefox
i want to replace particular word with new value into same text file
My Text file like (test.txt)
Hello
How are u
now i want to replace "Hi " on the place of "Hello" in same file
i want out put like(test.txt)
Hi
How are u
In both case filename is same
Any idea
Thanks in advance
Comments
var $fileContents = _readFile("text.txt");
var $lines = $fileContents.replace(/Hello/g, 'hi').split("\n");
but how to get output in test.txt file like
Hi
How are u
var $fileContents = _readFile("text.txt");
var $modified = $fileContents.replace(/Hello/g, 'hi');
_writeFile($modified, "text.txt", true);
thank u thank u so much
can i get document of sahi programming
Have a look at the links on the right side on http://sahi.co.in/w/sahi
Regards,
Narayan