Rawns Posted September 8, 2010 Posted September 8, 2010 (edited) Is it possible to find and replace in DOS? I need to replace a single character in a file on various workstations... Edited September 8, 2010 by Rawns
mattx Posted September 8, 2010 Posted September 8, 2010 (edited) Is it possible to FIND and replace in DOS? I need to replace a single character in a file on various workstations... Will the 'findstr' & 'change' command help you ?CHANGE.ZIP Edited September 8, 2010 by mattx 1
vikpaw Posted September 8, 2010 Posted September 8, 2010 It can be done but i haven't done it for a while. There is a FIND command MS-DOS find command help, and here's a link to some help with string manipulation commands DOS - String Manipulation i'd probably use vbscript, or even some text editors will do that sort of thing now, the advanced notepad replacement types like textedit,notepad++ i'm sure they all do advanced find and replace across multiple docs. I would search for all the files you need then open them in the text editor from the search window and do it that way. 1
Rawns Posted September 8, 2010 Author Posted September 8, 2010 Thanks Mattix , I used the CHANGE.COM file and incorporated it nicely into a little batch file that's worked a treat.
srochford Posted September 8, 2010 Posted September 8, 2010 Good to see you're sorted but for the future you might want to use FART: Find And Replace Text just because it has a wonderful name :-)
mattx Posted September 8, 2010 Posted September 8, 2010 Thanks Mattix , I used the CHANGE.COM file and incorporated it nicely into a little batch file that's worked a treat. Not a problem - I used to love scripting in DOS many years ago - once incorporated a complete auto install procedure for a windows95 build for a token ring network in my old job..... Every single aspect of the image was all DOS batch stuff. I'll shutup now as: A: I'm quite pi55ed - [ Almost exploded today as I have had to really really bite my tongue ] B: My Wine glass is empty C: My tea is almost ready
PiqueABoo Posted September 9, 2010 Posted September 9, 2010 For some reason most of these seem to be stuck in the genuine DOS world so I ended up writing my own util to get a job done. Lots of them would do ASCII (one byte per character) replaces, but I didn't find one that would also play nicely with the Unicode varieties e.g. some of those increasingly ubiquitous XML config files you might want to patch. IIRC I found something like eight different format varieties of what are superficially "text files".
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now