Batch Scripting Help needed-Complicated Logic

September 9, 2010 at 05:51:31
Specs: DOS
Hi I am using Microsoft Windows XP [Version 5.1.2600]
I have a file called rcf.log which consists versions of my application like...
2.0.2.0_Rev0
2.0.2.1_Rev0
2.0.2.1_Rev1
2.0.4.0_Rev0


In my application the current version could be reflecting as "Ver 2.0.2.0 Rev0" or "Ver 2.0.2.0" or "2.0.2.0_Rev0" with any naming convention but with guaranteed format of *.*.*.*

Now my requirement is, suppose my application's current version "2.0.2.1 Rev0" and i want to upgrade it to "2.0.4.0 Rev0" automatically.
I have my script ready for calling the upgrade subroutine.
My only problem is I am unable to pass the version numbers to this subroutine.
The difference between current and target version say 2 versions i.e 2.0.2.1_Rev1,2.0.4.0_Rev0... I have to pass these 2 versions for 2 times to my upgrade subroutine to upgrade my application to 2.0.4.0_Rev0


Can any one help me how i can do this?? rcf.log is flexible format and we can change the format of the file contents if helps to achieve the requirement.

Thanks inadvance.


See More: Batch Scripting Help needed-Complicated Logic

Report •


#1
September 9, 2010 at 10:24:17
Does this boil down to separating the *.*.*.* from the revx?


=====================================
Helping others achieve escape felicity

M2


Report •

#2
September 9, 2010 at 13:33:15
Sorry Mechanix2go....I did not get exactly what you are pointing to...
Ok..Each * in "*.*.*.* Rev*" represents a numeric value...this is a standard format.
Now I have to fetch these "*" real format (string presentation will do) and send to another subroutine...

Please do let me know how can we achieve this.

Thanks inadvance.


Report •

#3
September 9, 2010 at 20:32:11
Do you want to get the *.*.*.* into a var?


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions

#4
September 9, 2010 at 22:20:43
Yes....
Basically i need two inputs for my subroutine
1. *.*.*.* (from string Ver 2.0.4.0 Rev0)
2.Rev* (from Ver 2.0.4.0 Rev0)


Report •

#5
September 10, 2010 at 01:17:09
@echo off & setLocal EnableDELAYedeXpansion

for /f "tokens=1-3 delims=_ " %%a in (myrev) do (
echo.%%a %%b
)


=====================================
Helping others achieve escape felicity

M2


Report •


Ask Question