tags:

views:

106

answers:

1

Hello,

I want to create .bat application that read into text file, find / and remove it.

FROM PPD/HQ ALLEN/BRAD/MR

change to:-

FROM PPD HQ ALLEN BRAD MR

Eliminate the / and save in other text file will be just fine.

I'm a newbie and help me to enter DOS world.

Thnx!

A: 

Does this really have to be pure MS-DOS? As in, no Windows, no extra tools? If you mean a "DOS Box" -- really, a Windows console -- and are able to install a little software to help you, this one-liner will do it:

$ tr / ' ' < original-file.txt > new-file.txt

That's Bash shell syntax calling the POSIX tr program, rather than an MS-DOS style batch program. The Unixy command line offered by Cygwin is vastly more powerful than the legacy MS-DOS stuff, even with the minor enhancements Microsoft has added over the years.

Plus, it's a gateway into the Linux/BSD/OS X/Unix world, another fun place to play.

Warren Young