And if you want a little VBS script to start from, you can always take this
and develop it further.
Paste this into Notepad, and save as a .VBS file. Then double click it.

If it goes wrong (as it surely will!!!!), you will need to close the Excel
process that has been started - use Ctrl-Alt-Del and the Task Manager,
Processes.

'----------Code-------------
'Open the Excel spreadsheet - it should be empty to start with!
set XL=WScript.CreateObject("Excel.Application")
xl.Application.Workbooks.Open "C:\temp\test.xls"
xl.Worksheets(1).Select

'Open the input file with the information in it
set fso = wscript.createobject("Scripting.FileSystemObject")
Set OStream = fso.OpenTextFile("C:\temp\INPUT.txt")

'Set some variables. iXLline says which row we will start to store the data
on
Dim X
iXLLine = 3

'Loop around, reading lines from the text file
Do while not OStream.AtEndOfLine
  InLine = OStream.ReadLine
  ' For each line read from the file, split it into chunks based on a space
  X = split(InLine, " ")
  For i = 0 to ubound(x)
      'Set a range where we are going to store the results. 65 = Column A
      strRange = chr(i + 65) & iXLLine
      ' Now store the data read in. STore it in the cell range calculated
      if isNumeric (X(i)) then
          xl.Range(strRange) = "'" & X(i)
      else
          xl.Range(strRange) = X(i)
      end if
  Next

'Store the next line on the next row in the spreadsheet
iXLLine = iXLLine + 1
Loop

'Finally we close the spreadsheet and input file
OStream.Close
xl.quit
set XL = nothing
'----------End Code--------

-----Original Message-----
From: King, John [mailto:[EMAIL PROTECTED]]
Sent: 11 December 2002 15:29
To: Exchange Discussions
Subject: RE: Very OT - txt handling


Umm yeah that would be cool, but if you have Visual Basic that maybe a good
route.  It would be easy to parse the text file and then write it out to a
csv file.  A csv file will open in Excel and look fine.  Then compile exe
and schedule to run at any time.  As a matter of fact you could probably do
it just the same with VBscrit if you don't have visual basic.

        Good Luck,
        John

-----Original Message-----
From: Mellott, Bill [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 10:06 AM
To: Exchange Discussions
Subject: RE: Very OT - txt handling


You could get the MS UNix service 3.0 very inexpensively..

It's cool..work pretty well for the tools Ive used so far..
cheap for what you get and it's power..

has may unix thing ported to MS/win32

bill

-----Original Message-----
From: King, Arron S. [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 8:37 AM
To: Exchange Discussions
Subject: RE: Very OT - txt handling


Kim,

There are several things that might be of help.

A combination of Unix tools (ported to Win32 of course) grep & wc  (grep can
search for text/regular expression and wc can count lines, characters etc.
This will find out the stats you want; but won't automatically update the
files.  You can create text files; but would need to import them.  Search
google for the win32 ports of these utilites.  I don't have an exact URL.

Perl is an excellent language for parsing text.  You should be able to use
it to count up the statistics you are looking for, and then create/update a
document like it sounds like you want to do.  http://www.activestate.com


HTH

Arron


=======================================
Arron S. King
Network & Systems Administrator
Ohio Dominican University

[EMAIL PROTECTED]
v: 614.251.4515
f:  614.252.2650




-----Original Message-----
From: Kim Schotanus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 7:13 AM
To: Exchange Discussions
Subject: Very OT - txt handling


Hi there, 
 
I came across your address on the net, and I would like to ask you a
quick programming question.  Could you point me out to a sort of code
that can count the number of characters and lines in a txt file and
transfer that to exell or access? 
 
I have the following example (txt)
 
45 14:53:52 ENTRANCE ARTS (2) ACCESS GRANTED KIM SCHOTANUS (16788937)
46 15:14:52 EXIT ARTS GRANTED
47 16:00:48 ENTRANCE ARTS (2) ACCESS GRANTED PROCOPIO ALB (07723137)
48 16:52:24 EXIT ARTS (3) ACCESS GRANTED BECKERS PAUL (04906723)
...
 
In this example the first line is the line number, that is reset to 00
after 99, then there is the time, the action performed -ENTRANCE ARTS
(2) ACCESS GRANTED- and the name and permission code.
Line 46 is a special command, this is when someone overrides the system
(which happens quite often)
 
after each 20 lines there is a blank line and then a line with the date
 
The idea is to find/create a little code that pushes the data in this
txt file to exell on a daily basis.
 
Do you know of any code that could do this?
 

_________________________________________________________________
List posting FAQ:       http://www.swinc.com/resource/exch_faq.htm
Archives:               http://www.swynk.com/sitesearch/search.asp
To unsubscribe:         mailto:[EMAIL PROTECTED]
Exchange List admin:    [EMAIL PROTECTED]

_________________________________________________________________
List posting FAQ:       http://www.swinc.com/resource/exch_faq.htm
Archives:               http://www.swynk.com/sitesearch/search.asp
To unsubscribe:         mailto:[EMAIL PROTECTED]
Exchange List admin:    [EMAIL PROTECTED]

_________________________________________________________________
List posting FAQ:       http://www.swinc.com/resource/exch_faq.htm
Archives:               http://www.swynk.com/sitesearch/search.asp
To unsubscribe:         mailto:[EMAIL PROTECTED]
Exchange List admin:    [EMAIL PROTECTED]

_________________________________________________________________
List posting FAQ:       http://www.swinc.com/resource/exch_faq.htm
Archives:               http://www.swynk.com/sitesearch/search.asp
To unsubscribe:         mailto:[EMAIL PROTECTED]
Exchange List admin:    [EMAIL PROTECTED]

_________________________________________________________________
List posting FAQ:       http://www.swinc.com/resource/exch_faq.htm
Archives:               http://www.swynk.com/sitesearch/search.asp
To unsubscribe:         mailto:[EMAIL PROTECTED]
Exchange List admin:    [EMAIL PROTECTED]

Reply via email to