Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: /F use of multiple values in delim  (Read 3344 times)

0 Members and 1 Guest are viewing this topic.

tommyb

    Topic Starter


    Greenhorn

    • Experience: Beginner
    • OS: Windows 7
    /F use of multiple values in delim
    « on: March 26, 2014, 08:44:22 AM »
    I have a vendor supplied name with multiple unique separators. (example "RCM_SAR_Form_02-28-2014 14:342854MNB"). I need to parse to proivde a FIXED filename to the next phase. I can not get the delim parameter to accept the mutiple unique separators a <space>, a underscore, a hypen,  and a colon).  Even if I get that problem to work I am left with how to separate the MM from the last field 322854MNB.
     
    I am a rookie on Dos Command experience but thought this forum might enjoy helping a rookie. I hope when I get the parsed values in variables I be able to build the rename.   

    Would anyone be willing to share how to code the delim=   with multiple values listed.
    Also a technique to separate the MM (minute field after the colon) from 2854MNB character field at the end.

    Thank you in advance for sharing you skills and experience in this area.
    TommyB

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: /F use of multiple values in delim
    « Reply #1 on: March 26, 2014, 09:35:51 AM »
    Code: [Select]
    for /f "tokens=1-8 delims=_-: " %%I in ("RCM_SAR_Form_02-28-2014 14:342854MNB") do (
         echo %%I
         echo %%J
         echo %%K
         echo %%L
         echo %%M
         echo %%N
         echo %%O
         echo %%P
    )

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: /F use of multiple values in delim
    « Reply #2 on: March 26, 2014, 02:21:23 PM »
    I am a rookie on Dos Command experience but thought this forum might enjoy helping a rookie.

    It's all good fun when we know what the problem is - as it stands we don't know what variation there is in the name format.  Are all lines in that exact format?

    What do you have to do with the lines, apart from get the minute count?