Re: Output to txt:

From: Roland Hall (nobody_at_nowhere)
Date: 04/04/04


Date: Sat, 3 Apr 2004 22:09:36 -0600


"TDM" wrote in message news:tFzbc.4544$Zw.2387@nwrddc02.gnilink.net...
: My current need arises from a script I wrote to parse the event logs.
:
: The output starts with the column titles. They can range in string length
: based on what event ID I query on. Then to follow, are all the entries
: for the queried event ID. I just think it would be nice for all the
entries
: to line up with the column titles. Some if the entries also have very long
: string entries, so in many situations, the column title is not as long as
: the
: column entry. To get around this for now, I format the output as html
: and set up all the entries in tables with a border so it looks somewhat
: decent and it all lines up. But, the ideal solution for me would be a text
: file formatted with all the entries left aligned with the column title.
The
: harry part(at least for me) is when the "entry" string length is large,
then
: you would need to wrap the lines a number of times as needed to get it
: to fit nicely in the "column". At the very least, it would be nice to
simply
: have the entry left align with the column title. I will try to illustrate.
:
: ColTitle1 ColTitle2
: ColTitle3
:
: Coll entry 123456790 Col entry yada yada yada yada Col entry
: xxxxxxxxyyyy
:
: Not sure how this will come across in your news reader. But the Col
: entries can be very long in length at times. I tried stuffing all this in
to
: arrays as the titles come before the entries, so to line them up properly,
: you need to know the max string length for each column in order to
: line up entries correctly. But, I ran short of time and chose the HTML
: solution instead. To make things even a bit more messy, the number
: of columns is not fixed, it can vary based on the event ID you query.
:
: Another ray of hope(no pun intended Ray at work) is the logParser supports
: various different output formats that I have not messed with yet. I am
: currently
: using the "native" output format. If I find the time, I will play with
this
: some but
: for now, I am almost there. I just need some help with formatting the
: output.
:
: Some general things to try would be nice, and I sure hope all this
: makes sense.

Is this similar to what you need?

column1 column2 column3
111111 2222222 333333
111111 2222222 333333

I disagree with the method of storing the file formatted how you will
display it. Is it not true that Log files can be exported to CSV format?
Wouldn't that make it easier?

With text, you also have to deal with proportional and non-proportional
fonts.

Questions:
When the file is viewed, what is the viewer used?

Word stores a file with embedded code to display it as it is seen on screen
in Word. Saving a file as plain text will lost all formatting, including
text attributes, etc. and will convert tabs [chr(9)] to a specified number
of spaces, generally 8.

I use tabs a lot when writing code in VS6. I set my tab size to 2
characters. If you go to one of my pages and view the source, you will see
8 characters used in Notepad because it defaults to 8 characters for a tab
size. So, the viewer used is important to how the text is displayed.

Since all viewers can use pretty much what they want, code is used to modify
the displayed output. Programmatically, you could alter it with HTML/CSS
because it is designed to modify the displayed output but even the browsers
do not conform to a standard to do that.

If your viewer is a specific browser, and your log file can be stored in CSV
format, would that not make it easier to manipulate the output to what you
wanted once it is viewed?

-- 
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


Relevant Pages

  • Re: How to create a window showing building block organiser in 2007
    ... doesn't display a "preview". ... show any formatting that's included in the entry; ... On the plus side, if the entries are all text, ... autotext at the location of the selection. ...
    (microsoft.public.word.vba.general)
  • Re: QDE (Quick Date Entry)
    ... The user DOES NOT have to enter dates in yyyy-mm-dd format. ... alternative 2- or 3-digit short date entry treatment. ... QDE is the logical opposite of a one-size-fits-all approach. ... I'll admit my macro doesn't handle such entries ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Output to txt:
    ... I just think it would be nice for all the entries ... To get around this for now, I format the output as html ... harry partis when the "entry" string length is large, ... >: Roland, ...
    (microsoft.public.scripting.vbscript)
  • Re: Formatting autocorrect
    ... insert a formatted auto-correct entry I need to accept the change otherwise ... 4567 entries that I have already. ... new format. ... To transfer the formatted autocorrect entries (actually, ...
    (microsoft.public.office.misc)
  • Re: Count and display entries
    ... I know you do not store data in forms, and I know forms are used to display ... have the number of entries displayed on the form. ... individual entry, and display the number in the "Number of Entries" field. ...
    (microsoft.public.access.formscoding)