It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

How do I write multiple lines of text into one line?

Moderator: dafunkymunky

How do I write multiple lines of text into one line?

Postby odgreen1 on Sat Feb 23, 2008 12:17 am

Hi,

I have many text files containing data that looks something like this:

Feb 1 19:00:04 Server1 auth|security:notice su: from root to patrol at /dev/tty??
Feb 1 21:30:46 Server1 auth|security:notice sudo: idmadmin : TTY=pts/1 ;
PWD=/home/idmadmin ; USER=root ; COMMAND=validate
Feb 1 21:30:46 Server1 auth|security:alert sudo: idmadmin : command not allowed ; TTY=pts/1 ; PWD=/home/idmadmin ; USER=root ;
COMMAND=/usr/bin/rm -f /tmp/WSlsuserAll.124250
/tmp/WSlsuserAllError.124250

I'm trying to use VBA script to read the file (using Line Input) and output it to a new file. My problem is that I want all text in between the first instance of "Feb 1" until the next instance of "Feb 1" on one line. Using Line Input I can only read one line at a time in a loop and haven't been able to figure out how to output multiple lines from the input file into one line in the output file. I've tried replacing Chr(10) and Chr(13) with nothing, but no go.

Any help is appreciated.
odgreen1
 
Posts: 0
Joined: Sat Feb 23, 2008 12:15 am
Location: St Louis, MO

Who is online

Users browsing this forum: No registered users and 0 guests