How to substring in nt - Windows NT

This is a discussion on How to substring in nt - Windows NT ; Hi Expert, How do i truncate a variable that has more than 8 character into eight character? Let say myvar=abcdefghijklm I want to cut into 8 character only into myvar=abcdefgh...

+ Reply to Thread
Results 1 to 4 of 4

Thread: How to substring in nt

  1. How to substring in nt

    Hi Expert,

    How do i truncate a variable that has more than 8 character into eight
    character?
    Let say
    myvar=abcdefghijklm
    I want to cut into 8 character only into myvar=abcdefgh



  2. Re: How to substring in nt

    Mike wrote:
    > Hi Expert,
    >
    > How do i truncate a variable that has more than 8 character into eight
    > character?
    > Let say
    > myvar=abcdefghijklm
    > I want to cut into 8 character only into myvar=abcdefgh
    >
    >


    set myvar=%myvar:~0,8%

    --
    Phil Robyn
    Univ. of California, Berkeley

    u n z i p m y a d d r e s s t o s e n d e - m a i l


  3. Re: How to substring in nt

    Phil Robyn wrote:
    > Mike wrote:
    > ...
    >> I want to cut into 8 character only into myvar=abcdefgh

    >
    > set myvar=%myvar:~0,8%
    >


    Quite interesting. Does anybody know a good comprehensive NT command
    language reference that cover this and other special features?

    Thanks,
    --
    To reply by e-mail, please remove the extra dot
    in the given address: m.collado -> mcollado


  4. Re: How to substring in nt

    On Fri, 05 Dec 2003 11:53:15 +0100, Manuel Collado
    wrote:

    >Phil Robyn wrote:
    >> Mike wrote:
    >> ...
    >>> I want to cut into 8 character only into myvar=abcdefgh

    >>
    >> set myvar=%myvar:~0,8%
    >>

    >
    >Quite interesting. Does anybody know a good comprehensive NT command
    >language reference that cover this and other special features?


    C:> set /?

    As far as a book, try _Windows NT Shell Scripting_.


+ Reply to Thread