1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

for /f and wild cards

Discussion in 'TCC/LE Support' started by David Marcus, Jul 24, 2011.

  1. David Marcus

    Joined:
    Jun 4, 2008
    Messages:
    648
    Likes Received:
    1
    The Help for FOR gives an example of "for /f "tokens=1,2,3" %d in (*.txt) ...". The wild card doesn't seem to work:

    Code:
    C:\Junk>type foo.btm
    for /f "tokens=1,2,3" %d in (*.txt) do echo %d
    
    C:\Junk>type foo.txt
    a b c
    d e f
    
    C:\Junk>foo.btm
    ECHO is OFF
    
    C:\Junk>ver /r
    
    TCC  12.11.70   Windows Vista [Version 6.0.6002]
    TCC Build 70   Windows Vista Build 6002  Service Pack 2
    Registered to David Marcus - 1 System License
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,868
    Likes Received:
    83
    WAD; the help is wrong.

    This was originally intended to be a feature (which CMD doesn't support), but we ran into problems with CMD batch files using wildcards that didn't expect them to be expanded.

    Fortunately, it's all doable (a LOT easier) with DO.
     

Share This Page