To compute values in text file - advance level

March 22, 2012 at 15:58:17
Specs: Windows 7
Please help me program the scenario below:
contents of myfile.txt:
ServerName: KDB2012
----------------------------
2:KSERVER\Bird
16:KSERVER\Dog
20:KSERVER\Cat
----------------------------
6:Animal
15:Animal
65:Animal

Now, I want to check "Animal" by its number, if that number (6 in our case) > 2 and < 16 (Black\whatever) then print Animal = Black\Bird
similarly if 15 > 16 and 15 < 20 then print Animal = Black\Dog
if 65 > 20 then print Animal = Black\Cat

I am in desperate need to do this, either using batch, VBs, Powershell. Much Appreciated!


See More: To compute values in text file - advance level

Report •

#1
March 23, 2012 at 09:19:11
Anyone knows a solution?

Report •

#2
March 26, 2012 at 13:11:14
Found two solutions
http://www.computerhope.com/forum/i...

Thanks to sidewinder and salmon trout


Report •
Related Solutions


Ask Question