PC Review


Reply
Thread Tools Rate Thread

can't i use type command in a for loop command?

 
 
thinktwice
Guest
Posts: n/a
 
      30th Apr 2008
for ....in (type file.txt|findstr...) do command
dos pompt doesn't accept the above command as a valid command, must i
use a temporarily file ?
 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      30th Apr 2008

"thinktwice" <(E-Mail Removed)> wrote in message
news:4e454edf-c8eb-4f8d-a1b7-(E-Mail Removed)...
> for ....in (type file.txt|findstr...) do command
> dos pompt doesn't accept the above command as a valid command, must i
> use a temporarily file ?


DOS is an operating system introduced some 30 years ago.
It is only rarely used these days and it cannot do this sort of
thing. However, the Command Prompt under Win2000 can,
e.g. like so in a batch file:

@echo off
for /F "delims=" %%a in ('findstr /c:test list.txt') do "%%a"

which is almost identical to the reply I gave you to your first post.


 
Reply With Quote
 
Tom Lavedas
Guest
Posts: n/a
 
      30th Apr 2008
On Apr 29, 11:06 pm, thinktwice <memorial...@gmail.com> wrote:
> for ....in (type file.txt|findstr...) do command
> dos pompt doesn't accept the above command as a valid command, must i
> use a temporarily file ?


Note foxidrive's answer to one of you many other questions. That is,
try .something like ...

for ....in (type file.txt ^|findstr...) do command

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Command line option syntax error. Type Command /? for Help §ñühw¤£f DIY PC 2 19th Apr 2009 10:23 PM
Command line option syntax.error.type command for hlp/? =?Utf-8?B?amVyZW15?= Microsoft Outlook Discussion 6 29th Oct 2006 07:16 PM
Excel to load COMMAND and type a Run Command? Shaka215@gmail.com Microsoft Excel Programming 5 22nd Aug 2006 10:47 PM
Getting not recognized command when I type in any command . =?Utf-8?B?TW9r?= Microsoft Windows 2000 CMD Promt 6 9th Jan 2005 12:27 AM
Command Line Option Syntax Error - Type Command /? for Help Bob Breslin Microsoft Outlook Interoperability 2 14th Dec 2004 06:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:00 AM.