Advertisement

02.14.2007 at 06:59PM PST, ID: 22390494
[x]
Attachment Details

Append part of an existing log file to a archive log file

Asked by nmcdermaid in MS DOS, Windows Batch Scripting

Tags: , ,

Hi Experts,

I have a log file which is overwritten everytime a process runs. Among other things, its got a line like this in it:

Thu 15 Feb 2007 11:39:04 AM      4      0016C197      Timing, TOTAL TIME (CREATE CUBE),00:05:41

FYI Its a Cognos Transformer log file

Ideally I want a cmd file that will append just this part to an archive log file

The big picture is that I want a batch file that:

1. Builds the cube (therefore writing the log file) - this part is already done.
2. Runs or calls some magic batch script which copies the above line into a master log file.


The master log file should also have the name of the source log file in it.


Therefore the variables going into the script are:

-Path to the source log file
-The path to the master log file

Ideally the example script will define these as environment variables beforehand


So if I build a couple of different cubes over a couple of different days I'd like to see this in my master log file (spaces removed for clarity):

NameOfCube1  Thu 15 Feb 2007 11:39:04 AM  4  0016C197  Timing, TOTAL TIME (CREATE CUBE),00:05:41
NameOfCube2  Thu 15 Feb 2007 12:39:04 AM  4  0016C197  Timing, TOTAL TIME (CREATE CUBE),00:06:00
NameOfCube1  Thu 16 Feb 2007 10:05:04 AM  4  0016C197  Timing, TOTAL TIME (CREATE CUBE),00:02:31

The delimiter between the name of the cube and the copied log line should be a tab.

NameOfCube1 indicates that line came from a file called NameOfCube1.LOG

Thanks for your help.Start Free Trial
[+][-]02.14.2007 at 07:09PM PST, ID: 18537668

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.14.2007 at 08:29PM PST, ID: 18537963

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.14.2007 at 08:33PM PST, ID: 18537972

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.14.2007 at 08:34PM PST, ID: 18537980

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS DOS, Windows Batch Scripting
Tags: append, log, file
Sign Up Now!
Solution Provided By: SteveGTR
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.14.2007 at 08:46PM PST, ID: 18538015

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.14.2007 at 08:55PM PST, ID: 18538049

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32