Remove / in text file with using DOS script
I want to create .bat application that read into text file, find / and 开发者_Python百科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!
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.
精彩评论