On 14.01.2014 14:21, ramesh ram wrote:
> Hi Herbert,
>
> Thanks for your response,As per my requirement i was trying that
> 1.find the last line record because it have the record count with
> eg:
> 99|20140114|10
> i want to substring of the above record from next date to last
> for above one 10 into a variable as well as it need to generate file using that variable like below
> set record_count=10
> same 10 into one text file
I don't understand what exactly you want to do. If you
just want to extract the information stored in the line
starting with 99 in a file a.txt, try this:
for /f "tokens=1-3 delims=^|" %%i in ('findstr " \<99" a.txt') do (
set a=%%i
set b=%%j
set c=%%k)
echo footer token: %a%
echo date: %b%
echo record_count: %c%