About For file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

About For file

#1 Post by Ed Dyreen » 31 May 2011 04:07

I was just wondering, we can do
for /f %%! in (file) do
for /f "useback tokens=*" %%! in (
'type file'
) do

But we can't do
for /f %%! in ( "C:\windows\win ooooows" ) do

for does not allow a file between quotes, is there a solution :?:

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: About For file

#2 Post by Cleptography » 31 May 2011 04:35

You can't do that batch for doesn't know how to process files, they are bad mojo they don't work.
For sees a file and says forget that I don't want to. Quotes who knows what the hell those are for you bastard.
Stop talking to yourself it makes you look crazy.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: About For file

#3 Post by Ed Dyreen » 31 May 2011 04:39

Stop talking to yourself it makes you look crazy.


It was ment as a question :|

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: About For file

#4 Post by Cleptography » 31 May 2011 05:06

Why do you ask questions to which you already know the answers to?

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: About For file

#5 Post by Ed Dyreen » 31 May 2011 05:15

i don't :|
I really wish i could do this with for

for /f %%! in ( File Name.ext ) do

but it does File &Name.ext instead of just looking for 'File Name.ext'

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: About For file

#6 Post by Ed Dyreen » 31 May 2011 05:26

Why do you ask questions to which you already know the answers to?

Look who's talking :evil:

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: About For file

#7 Post by Cleptography » 31 May 2011 05:29

I don't anything about batch
Why we can't
for /f %%! in ( "C:\windows\win ooooows" ) do
but we can for /f "useback tokens=*" %%! in ("c:\windows\blow up this box\billy madison.txt")
Someone will surely have the right answer.
It makes no sense to me either.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: About For file

#8 Post by Ed Dyreen » 31 May 2011 05:39

:idea: IT WORKS !!!

for /f "useback tokens=*" %%! in ( "TST.TXT" ) do echo.%%!

I knew it, I forgot it, now I remember thanx to u.

That's not what the help says though

Code: Select all

FOR /F ["opties"] %variable IN (bestandsset) DO opdracht [opdrachtparameters]
FOR /F ["opties"] %variable IN ('tekenreeks') DO opdracht [opdrachtparam.]
FOR /F ["opties"] %variable IN (`opdracht`) DO opdracht [opdrachtparameters]

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: About For file

#9 Post by Cleptography » 31 May 2011 05:42

Clever had to fix something someone broke.
The help is right the program is wrong :wink:
All fixed now. :mrgreen:

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: About For file

#10 Post by orange_batch » 31 May 2011 11:51

Blah blah blah guys. lol Yes,

Code: Select all

for /f "usebackq" %%x in ("my file path") do ...

Post Reply