-
Extracting text
How would you extract text from the MS-DOS command line? For example:
echo dir > new.txt
How would you get it to input "dir" into the command line. I know in that instance you could just pipe it into new.bat, but I want to know for any general curcumstance.
-
tree > file.txt
or
dir /p > file.txt
if you want more options for "tree" and "dir," simply type "help" before the command.
-
That pipes the info into file.txt , but I want to extract the information from file.txt .
-
Here's what I did. The contents of file.txt:
Then in the command prompt I typed:
And it ran the dir command.
mjk
-
oh, okay I understand now. That or this
more filename.txt | cmd
-
Ok, what if new.txt contained
192.168.1.100
and I wanted to have a program ping the IP from the txt file. How could I do that?
-
I don't think there's a way to do that with one command but if you has something like this in a batch file:
set a = more new.txt
ping a
..except I don't know how to use variables in batch files! You get the idea though.
mjk