Text file with grep

Sirs,
i am trying to create simple script file..
what i do is grep for a pattern and output 1 line after it.
exmp:
grep -A 1 time files.txt

Output:
time
file1
time
file2
---

Is there some option I can use so I can get on result each 2 lines combined as one file?
like:
time file1
time file2
time file3

Thanks beforehand

you want it to print the word "time" or the actual time of day? (11:09pm) I dont know if grep has an option like that. You might have to combine it with something like awk.

#more file1.txt
this is line 1 red
this is line 2 orange
this is line 3 yellow
this is line 4 green
this is line 5 blue
this is line 6 purple
this is line 7 blue
this is line 8 red
this is line 9 blue
this is line 10 red

So perhaps you want to grep for the lines with "blue" in them. what do you want your output to look like?
example output
#./script

11:20am this is line 5 blue
11:20am this is line 7 blue
11:20am this is line 9 blue

btw I am just writing this reply to see if i got your question correct. I'm sure theres a very elegant way to do this. Your answer will come shortly I'm sure. People here are VERY good!

---------- Post updated at 01:42 PM ---------- Previous update was at 01:23 PM ----------

or perhaps yoru input file already has the times and you are looking for specific times? example
#more file1.txt
11:30am this is line 1
11:30pm this is line 2
11:00am this is line 3
11:00pm this is line 4
11:30am this is line 5
11:40pm this is line 6
11:30am this is line 7

and you want your output to only print the 11:30am lines?
Just trying to be as specific as possible so others can get you exactly the help you need.

$ 
$ 
$ cat -n files.txt
     1    blah
     2    time
     3    file1
     4    blah blah
     5    blah blah blah
     6    time
     7    file2
     8    file3
     9    blah blah blah blah
    10    time
    11    file4
    12    file5
$ 
$ # your command
$ grep time -A 1 files.txt
time
file1
--
time
file2
--
time
file4
$ 
$ # add a command via a pipeline
$ grep time -A 1 files.txt | perl -lne 'if (/^time/){printf} elsif (!/^--/){print " $_"}'
time file1
time file2
time file4
$ 
$ 

tyler_durden