Solved How to get each line value from txt file in cmd

June 13, 2012 at 01:29:42
Specs: Windows XP
hi....
I need to get line value after ":" from txt file in batch script
readme.txt

CONTENTS::
**Author of the Book**
AUTHOR: USER
**No Of Iteration**
ITERATION: 100
** Key Value**
KEY:1234567890
** Index**
INDEX:2


I need to get only USER,100,1234567890 and 2 without ":" from text file and need to store in variable.
Can anyone pls help me in solving this.


See More: How to get each line value from txt file in cmd

Report •


#1
June 13, 2012 at 02:17:30
✔ Best Answer
:: ===== script starts here ===============
::
:: ramp.bat Wed 13-06-2012 16:02:08.68
@echo off & setLocal enableDELAYedeXpansioN

set N=
for /f "tokens=2 delims=: " %%a in ('find ":" ^< myfile') do (
set /a N+=1
set V!N!=%%a
)
set
goto :eof

::====== script ends here =================


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
June 13, 2012 at 02:36:39
Thanks for your help..

~ram


Report •

Related Solutions


Ask Question