Solved tmp tempering

January 10, 2012 at 13:00:22
Specs: Windows XP
If i get a tmp.tmp file and edit the contents so it has numbered lines
(e.g. 1 hi
2 john
3 goo
4 blue) then use set /p var=Line: and finally use a findstr %var% tmp.tmp how do i put the displayed line into a variable and futher more take out the number.

See More: tmp tempering

Report •

January 16, 2012 at 08:31:05
I can help you with this, but can you clarify your question a bit?

Report •

January 20, 2012 at 09:40:18
✔ Best Answer
set /p var=Line# ?
for /f "tokens=1,2*" %%a in ('findstr %var% tmp.tmp') do echo Line number is %%a, value is %%b

that will give you the line number and the value as an echo, you can run any set commands that you want to.

not sure what you mean by take out number, the %%b gives you that value already.

Report •

Related Solutions

Ask Question