0

I want to make an CMD program that can find text in a text file and then replace it with something else. Example: I want to find: maleEquip1 and I want to change it to: anInt165 Is that possible with a CMD program?

RuuddR
  • 941
  • 4
  • 13
  • 25
  • 1
    CMD program is called a Batch script. – Himanshu Tyagi Sep 01 '14 at 12:30
  • refer : http://stackoverflow.com/q/23087463/3603806 and http://stackoverflow.com/questions/19764521/batch-file-to-search-and-replace-a-string – Himanshu Tyagi Sep 01 '14 at 12:31
  • Ok, Ty for pointing that out. and thanks for the links it helped. – RuuddR Sep 01 '14 at 12:39
  • possible duplicate of [How can you find and replace text in a file using the Windows command-line environment?](http://stackoverflow.com/questions/60034/how-can-you-find-and-replace-text-in-a-file-using-the-windows-command-line-envir) – dbenham Sep 01 '14 at 12:48
  • Go to This Page [link](https://stackoverflow.com/questions/23087463/batch-script-to-find-and-replace-a-string-in-text-file-within-a-minute-for-files) –  Aug 06 '19 at 10:14

1 Answers1

1

Yes, it is possible. But it's very uggly. I would suggest to not reinvent the wheel. If it's possible to use 3rd party software take a look at a tool called fnr (http://findandreplace.codeplex.com/). You can call it from your cmd with the desired parameters. It's realy fast and easy to use.

MichaelS
  • 5,941
  • 6
  • 31
  • 46