Re: [joseph4325] Matching a string and printing a variable on the same line
[In reply to]

Can't Post

You really have not told us enough to help much. Let me make a few guesses. It seems as if you want to read some kind of a log file and display the time stamps of all entries which contain a specified message.

I will assume that you specfy the message by including a key word or phrase on the command line. From your example, I assume that the log file contains nothing but valid entries. Each entry is on one line. Each entry consists of a time-stamp, a space, a hyphen, a space, and the message. Assuming that the log file is called "mylogfile.log", The following code shold get you started.