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

@WORD[1-2,...] ?

Discussion in 'Support' started by vefatica, Jan 6, 2013.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,792
    Likes Received:
    29
    This works fine; every line has a word 1:
    Code:
    v:\> do l in /p tasklist ( echo %@word[1,%l] )
    [System
    System
    smss
    csrss
    *** SNIP ***
    But when I ask for words 1-2 (or 1-9999) I don't even get word 1. What's happening here?
    Code:
    v:\> do l in /p tasklist ( echo %@word[1-2,%l] )
    [System Process]
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    taskhost          Task
    dwm              DWM
    explorer          Program
    ECHO is OFF
    winpm-32          Pegasus
    powerpro          Physimem
    OUTLOOK          RE:
    ECHO is OFF
    firefox          A
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,792
    Likes Received:
    29
    In simpler examples, it's OK.
    Code:
    v:\4utilcopy> echo %@word[1-2,PID scvhost]
    scvhost
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,792
    Likes Received:
    29
    It seems that Frank, in another thread, found the culprit ... separators at the end of the string.
    Code:
    v:\> echo %@word[1-9999,PID scvhost]
    scvhost
     
    v:\> echo %@word[1-9999,PID scvhost ]
    ECHO is OFF
     
    v:\> echo %@word["-",1-9999,PID-scvhost]
    scvhost
     
    v:\> echo %@word["-",1-9999,PID-scvhost---]
    ECHO is OFF
     

Share This Page