HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Software Newsgroups > Windows XP

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 03-06-2008, 05:33 PM
bru
 
Posts: n/a
Default Batch file help - string manipulation

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?
Reply With Quote
Sponsored Links
  #2  
Old 03-06-2008, 07:51 PM
Pegasus \(MVP\)
 
Posts: n/a
Default Re: Batch file help - string manipulation


"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%


Reply With Quote
  #3  
Old 03-06-2008, 08:39 PM
bru
 
Posts: n/a
Default Re: Batch file help - string manipulation

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!!!
Reply With Quote
  #4  
Old 03-06-2008, 08:47 PM
Pegasus \(MVP\)
 
Posts: n/a
Default Re: Batch file help - string manipulation


"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!!!


Thanks for the feedback.


Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
stopping a batch file if a file isn't found yawnmoth Windows XP 3 02-15-2008 09:23 PM
Batch file works in command line but not as a batch Danger Windows XP 7 02-05-2008 04:50 PM
Search string in .docx file neeses Windows XP 3 10-27-2007 02:07 AM
How do you copy a shortcut to a file with a batch file? Pegasus \(MVP\) Windows XP 11 04-13-2007 10:56 PM
"string STR_ERR_OS was not found in string table" demian Windows Vista Installation 1 03-30-2007 02:38 AM


All times are GMT. The time now is 08:58 AM.


Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger