Parsing a number

August 11, 2010 at 07:46:14
Specs: Windows XP
I am looking to make a batch command where the user key in a number as a variable (say 123456). I need my batch to parse out the first two characters and save as a variable, then the first three characters and save as another variable, then finish running using those variables... Any guidance would be greatly appreciated.

Thank you in advance for your time.

See More: Parsing a number

Report •

August 11, 2010 at 09:06:32
@echo off & setLocal EnableDELAYedeXpansion

set /p v1=
set v2=!v1:~0,2!
set v3=!v1:~0,3!

Helping others achieve escape felicity


Report •
Related Solutions

Ask Question