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

@Word from Lines with Pipes

Discussion in 'Support' started by TonyT, May 31, 2011.

  1. TonyT

    Joined:
    May 29, 2011
    Messages:
    17
    Likes Received:
    0
    html files have lots of what looks like redirects "<" and ">". How can one read from such files, e.g.

    copy http://jpsoft.com/forums/ test.txt
    Echo %@Word[0,%@Line[Test.txt,0]]

    gives an error "The system can not find the file specified"
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    One way is to use SETDOS /X to disable special handling of some characters. SETDOS /X-6 will disable redirection.

    Here's another possible approach:
    http://www.unm.edu/~cdye/plugins/safechars.html
     
  3. TonyT

    Joined:
    May 29, 2011
    Messages:
    17
    Likes Received:
    0
    | One way is to use SETDOS /X to disable special handling of some characters. SETDOS /X-6 will disable redirection.

    I tried this and it looks likes it is working great. Thanks for the solution. This problem confounded me for ages. Hence the batch file should look like that:

    copy http://jpsoft.com/forums/ test.txt
    SETDOS /X-6
    Echo %@Word[0,%@Line[Test.txt,0]]


    | Here's another possible approach:
    http://www.unm.edu/~cdye/plugins/safechars.html

    Thanks also for this great tip.

    Tony Tschanz
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    And if you put it inside a SETLOCAL / ENDLOCAL block, your original settings (probably, but not necessary, the default) will be restored at the end.
     

Share This Page