Parsing text file through a batch

Discussion in 'Shell Script' started by Grep, Aug 28, 2010.

  1. Grep

    Grep New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hey guys,

    Hope I'm not posting into the wrong section. I think I have something very simple that i'm having a lot of trouble with. I have a text file called "file.txt"

    It contains:
    TagString=V3,SCC-COM,WXF1A20V0556,WXE1A2071007,PREBI
    TagString=V3,SCC-COM,WXK1A1045668,WXG1A30F3909,POSTBI
    TagString=V3,SCC-COM,WMAYP0002467,WMAYP0002769,BI

    I want to run a batch file that'll parse the 1st & 2nd token.

    So:

    for /f "tokens=3,4,5 delims=," %i in (file.txt) do @echo %i %j %k
    why won't this work?

    Thanks.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice