The great FART utility seems to be the norm when trying to replace text on the windows command line.
However I can't get it to work as shown in the examples. My test file test.txt:
Images Here Images
ImagesWhateverImagesI now try this:
fart -r -i -p "test.txt" "Images"and get:
Images Here Images
ImagesWhateverImages
Found 4 occurence(s) in 1 file(s).Great! But when now trying to replace Images with Foo it won't work:
fart -r -i -p "test.txt" "Images" "foo"
--> Replaced 0 occurence(s) in 1 file(s).Everyone seems to just do a fart -r -i- p <filename> <string_to_replace> <replacement> command and work with it. What am I doing wrong?
1 Answer
Is this a trick question? FART's usage help clearly states that -p stands for "preview", so if you remove it the changes will actually be made.
(Also, -r isn't required if you're only dealing with a single file.)