Search found 9 matches

by psytae
20 Jul 2012 09:13
Forum: DOS Batch Forum
Topic: CMD Batch File Variable Help
Replies: 5
Views: 3914

Re: CMD Batch File Variable Help

FOR /F "tokens=1,2,3,6" %%A in (C:\downloads\Needed_Initial_Information\output.txt) do ( :ECHO 1[%%A] 2[%%B] 3[%%C] 6[%%D] IF "%%~D" == "" ( BREAK ) ELSE ( ECHO 6[%%D] SET DOMAIN=%%D ECHO !DOMAIN! ) ) This did get it to work, I was trying all the different things I cou...
by psytae
20 Jul 2012 08:48
Forum: DOS Batch Forum
Topic: CMD Batch File Variable Help
Replies: 5
Views: 3914

Re: CMD Batch File Variable Help

I forgot to put this in my post.

The top two lines of my batch file contain.

Code: Select all

:@ECHO off
setlocal EnableExtensions EnableDelayedExpansion
by psytae
20 Jul 2012 08:40
Forum: DOS Batch Forum
Topic: CMD Batch File Variable Help
Replies: 5
Views: 3914

CMD Batch File Variable Help

When working directly with a cmd prompt this works. setlocal set DOMAIN=test ECHO %DOMAIN% test when trying to do something similar in a cmd file FOR /F "tokens=1,2,3,6" %%A in (output.txt) do ( :ECHO 1[%%A] 2[%%B] 3[%%C] 6[%%D] IF "%%~D" == "" ( BREAK ) ELSE ( ECHO 6[%...
by psytae
02 Sep 2011 15:20
Forum: DOS Batch Forum
Topic: CMD File For /f help
Replies: 8
Views: 6010

Re: CMD File For /f help

That worked for me. It did exactly what I was looking for. Thank you very much Ed.
by psytae
02 Sep 2011 14:38
Forum: DOS Batch Forum
Topic: CMD File For /f help
Replies: 8
Views: 6010

Re: CMD File For /f help

This works but oposite I want it to strips out the words I want written to the file and writes the words I don't want written to the file. For /F "tokens=2" %%B in (C:\output.txt) do FOR %%C in ( "-dns" "Network" "Directory" "Node" "Manager"...
by psytae
02 Sep 2011 13:45
Forum: DOS Batch Forum
Topic: CMD File For /f help
Replies: 8
Views: 6010

Re: CMD File For /f help

Ed I just tested your script and it did the exact oposite of what I was wanting it to do. It stripped out the part I actually wanted to write to the file and wrote to the file the part I didn't want it to write. So it is closer then I have been able to do so far however I just need to get it to writ...
by psytae
02 Sep 2011 13:35
Forum: DOS Batch Forum
Topic: CMD File For /f help
Replies: 8
Views: 6010

Re: CMD File For /f help

why the ~ in the do if /i statement?

Keep in mind I am very new writing this kind of code.

Thanks
by psytae
02 Sep 2011 13:25
Forum: DOS Batch Forum
Topic: CMD File For /f help
Replies: 8
Views: 6010

Re: CMD File For /f help

Here is the output currently of my nodes.txt file keep in mind I don't want it to write to the file when it shows -dns, Network, Directory, Node, and Manager. everything else I would like it to actually write to the nodes.txt file. -dns Network Directory Node tobias handel mahler chopin straub dvora...
by psytae
02 Sep 2011 11:26
Forum: DOS Batch Forum
Topic: CMD File For /f help
Replies: 8
Views: 6010

CMD File For /f help

I am trying to write a text file called nodes.txt with only the information I don't exactly know could be in the token 2 spot in the output.txt file already. I can't seem to get it. I have tried a few different ways and nothing will work I could really use some help below is the line I just can't se...