I have ~100 text files and each have the same typing error in them, I am looking for a program that will allow me to open all of them and then replace a certain piece of text in all 100. For example, I want to open up all the text files, choose replace and replace "text1" with "text2" in every text file, but not have to do it manually. Any help on this would be great. Thanks
if you're using linux (or have access to it), open up vi(m) esc then enter: :1,$s/text1/text2/g then :wq then for each subsequent file: :1,$s :wq The first two say replace text1 with text two on all lines, wq means write quit The second set will repeat the search/replace without typing everything in.
Thanks for the reply, I did have linux installed as a virtual machine, but had to remove it as I ran out of disk space So ideally I need something that would work on Windows.
gvim works on windows... but it won't be fast doing it file by file... If you mail/PM me what needs to be changed, I'll sort it out with a bash script for you
If you do not like Nix tools you can use Ultra Edit 32 if I remember well ... It has a tickbox to apply the changes to all files in a folder or something like that ... If you are familiar with Nix shells (bash, tcsh ... etc), you can use find. If you do not know how to use the find command on unixes, you can type "man find" the Linux man for find has an example on how to apply a command on every file. Then you can use sed to make text transformations. If you are familiar with Perl, it is quite easy and should not take more than few lines ...