VOGONS


First post, by keropi

User metadata
Rank l33t++
Rank
l33t++

Hiya!!!

I am searching (without luck 😐 ) for a DOS utility that can replace strings inside a text file...

something like this: awesomeutil.exe test.txt dog cat
so that awesomeutil opens test.txt finds the string "dog" and replaces it with "cat"

All I can find are some enhanced scripting methods that only work in win2k and above dos-box "termninals" ...

Any help will be greatly appreciated, thanks! 😊

Last edited by keropi on 2010-11-03, 19:40. Edited 1 time in total.

🎵 🎧 MK1869, PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 1 of 9, by retro games 100

User metadata
Rank l33t
Rank
l33t

awesome~1.exe woof meow 😉

Reply 2 of 9, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Find a set of djgpp converted unix tools that run in dos

Reply 4 of 9, by 5u3

User metadata
Rank Oldbie
Rank
Oldbie
keropi wrote:

that was the easy part, but I am confused about what part of the djgpp does what I want 😢 😕

uf013530.gif

😉

Reply 6 of 9, by 5u3

User metadata
Rank Oldbie
Rank
Oldbie

Sorry for the nerd joke, but I couldn't resist... 😉

grep, awk and sed are useful tools for searching/replacing strings in files.

Reply 8 of 9, by Yushatak

User metadata
Rank Member
Rank
Member

If you can find Win32 console utilities to do what you want, you can use them in DOS (provided you've got a 32-bit CPU to work with) using Japheth's HX extender.

Reply 9 of 9, by keropi

User metadata
Rank l33t++
Rank
l33t++

I am only interested in a dos-only solution that does not need any kind of extenders... I am reading on sed and it's DOS versions here: http://www.cornerstonemag.com/sed/ but frankly it seems too much complicated for the small/simple use I plan for it... line buffers , operations and all are great , but for more complex jobs...

edit:

I think I found what I need , it is called MiniTrue and from the manual it looks promising:

Example 1 - The original MiniTrue

mtr -rnw * - Eastasia = Eurasia

This will replace all instances of "Eastasia" with "Eurasia" in all
files on the current drive. The -r option is necessary for scanning
to recurse through the subdirectories. The -n option will make
replacements automatically, and the -w option will only find whole
words

edit2: complete success! minitrue 2.02b does EXACTLY and easily the job 😁 anyone interested can grab it here: http://www.idiotsdelight.net/minitrue/
thanks for all the suggestions/pointers/help , if it wasn's for the djgpp/grer/sed/xyz stuff I would have never found about minitrue 😊

🎵 🎧 MK1869, PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website