-
May 22nd, 2004, 07:53 PM
#1
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.
It is better to die on your feet than to live on your knees.
-
May 22nd, 2004, 08:41 PM
#2
tree > file.txt
or
dir /p > file.txt
if you want more options for "tree" and "dir," simply type "help" before the command.
You shall no longer take things at second or third hand,
nor look through the eyes of the dead...You shall listen to all
sides and filter them for your self.
-Walt Whitman-
-
May 23rd, 2004, 05:45 AM
#3
That pipes the info into file.txt , but I want to extract the information from file.txt .
It is better to die on your feet than to live on your knees.
-
May 23rd, 2004, 07:09 AM
#4
Here's what I did. The contents of file.txt:
Then in the command prompt I typed:
And it ran the dir command.
mjk
-
May 23rd, 2004, 10:20 PM
#5
oh, okay I understand now. That or this
more filename.txt | cmd
You shall no longer take things at second or third hand,
nor look through the eyes of the dead...You shall listen to all
sides and filter them for your self.
-Walt Whitman-
-
May 26th, 2004, 02:13 AM
#6
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?
It is better to die on your feet than to live on your knees.
-
May 26th, 2004, 05:28 AM
#7
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|