Extract latest Data from Append Log file

Microsoft Introducing windows 98 2nd edt...
July 22, 2009 at 20:35:44
Specs: Windows XP, 2GH 2GB
Hi,

We are using ExMerge to export data daily and it keep on append to the same log file.

sample ExMerge Log:
Start: Jan 22 July 2009
*************************
[Time] ABC
[Time] XYZ
Completion
Start: Jan 23 July 2009
*************************
[Time] EFG
[Time] SPQ
Completion

Let say today is 23 Jan, we would like to extract those info for 23rd Jan and so the new output will be ..

Start: Jan 23 July 2009
*************************
[Time] EFG
[Time] SPQ
Completion

Appreciate it if you could assist.
Many thanks



See More: Extract latest Data from Append Log file

Report •


#1
July 22, 2009 at 20:44:51
Sorry, new to this forum.
Re-post.

Report •

#2
July 23, 2009 at 03:05:41
@echo off > newfile & setLocal enableDELAYedexpansion

for /f "tokens=1 delims=[]" %%a in ('find /n "Start:" ^< my.log') do (
set start=%%a
)
set N=

for /f "tokens=* delims= " %%a in (my.log) do (
set /a N+=1
if !N! geq !start! (
echo %%a >> newfile
)
)


=====================================
If at first you don't succeed, you're about average.

M2


Report •

Related Solutions


Ask Question