Solved in qlikview want to write a code 4 appending log file

May 29, 2012 at 00:39:10
Specs: Windows XP
how to append log files through batch file

See More: in qlikview want to write a code 4 appending log file

Report •


#1
May 29, 2012 at 15:01:23
✔ Best Answer
When it's a file that has contents all of which is is readable, one way is to use two > characters in the batch file.

E.g. you made a file "result.log" using a program "makelog.exe".

You want to be able to append to that log file.

(I'm assuming you have Word wrap enabled in Notepad - it isn't by default.)

In Notepad, make a file with this line, a carriage return (press Enter) at the end of the complete command line.

makelog.exe >> result.log (press Enter)

(One space before and after >>
No space between the end of the complete command line and pressing Enter)

(If you make a longer line, press Enter only at the end of the complete - entire - command line, if it scrolls (wraps) to the next line(s). )

(If you make more than one line, a carriage return (press Enter) at the end of every complete command line.)

Choose Save As, make the file extension .bat instead of .txt, choose a name for the file, e.g. AppendResultLog.bat.

When you run the batch file, e.g. run AppendResultLog if there's no other executable file that has the same first part, or run AppendResultLog.bat, the new data (text) will be added to the end of the existing contents.

You may need to add the path to where the .exe file is and the destination file is to the line so you can execute it anywhere in Windows.
e.g.
C:\Program Files\Program X\makelog.exe >> C:\Junk\result.log
.....

When you want to Edit a batch file (*.bat file) , DO NOT click on it - doing that will RUN it.

RIGHT click on it and choose Edit to open it.

You can choose Save rather than Save As if the file extension is already .bat .


Report •
Related Solutions


Ask Question