I have a batch file script and I am trying to modify a SET
variable which has an 12 digits and I am trying to remove
the first two digits. Such as:
set XXX=991234567890
and I want to remove the "99" in front.
In the help for SET there is information about using /a
and logical shift (<<>>), but (1) I don't understand how to
use it and (2) whether this what I want.
"bru" <bru@ha.com> wrote in message news:47D02AD4.2020700@ha.com...
>I have a batch file script and I am trying to modify a SET
> variable which has an 12 digits and I am trying to remove
> the first two digits. Such as:
> set XXX=991234567890
> and I want to remove the "99" in front.
>
> In the help for SET there is information about using /a
> and logical shift (<<>>), but (1) I don't understand how to
> use it and (2) whether this what I want.
>
> Can anyone assist?
You need to look at the substring function:
@echo off
set XXX=991234567890
set YYY=%XXX:~3%
Pegasus (MVP) wrote:
> "bru" <bru@ha.com> wrote in message news:47D02AD4.2020700@ha.com...
>> I have a batch file script and I am trying to modify a SET
>> variable which has an 12 digits and I am trying to remove
>> the first two digits. Such as:
>> set XXX=991234567890
>> and I want to remove the "99" in front.
>>
>> In the help for SET there is information about using /a
>> and logical shift (<<>>), but (1) I don't understand how to
>> use it and (2) whether this what I want.
>>
>> Can anyone assist?
>
> You need to look at the substring function:
> @echo off
> set XXX=991234567890
> set YYY=%XXX:~3%
Cool! Didn't find it in Windows help, but
did find it using SET/?.
"bru" <bru@ha.com> wrote in message news:47D05679.1030201@ha.com...
> Pegasus (MVP) wrote:
>> "bru" <bru@ha.com> wrote in message news:47D02AD4.2020700@ha.com...
>>> I have a batch file script and I am trying to modify a SET
>>> variable which has an 12 digits and I am trying to remove
>>> the first two digits. Such as:
>>> set XXX=991234567890
>>> and I want to remove the "99" in front.
>>>
>>> In the help for SET there is information about using /a
>>> and logical shift (<<>>), but (1) I don't understand how to
>>> use it and (2) whether this what I want.
>>>
>>> Can anyone assist?
>>
>> You need to look at the substring function:
>> @echo off
>> set XXX=991234567890
>> set YYY=%XXX:~3%
>
> Cool! Didn't find it in Windows help, but
> did find it using SET/?.
>
> Many thanks!!!