numbering some content of a file using grep or any other commands

Posted by ir01 on Super User See other posts from Super User or by ir01
Published on 2012-09-28T16:47:28Z Indexed on 2012/09/29 3:42 UTC
Read the original article Hit count: 419

Filed under:
|
|

I have a file like this:

==================================[RUN]===================================
result                : Ok
CPU time              : 0.016001 s

==================================[RUN]===================================
result                : Ok
CPU time              : 1.012010 s

i want to numbering RUNs like this

==================================[RUN 1]===================================
result                : Ok
CPU time              : 0.016001 s

==================================[RUN 2]===================================
result                : Ok
CPU time              : 1.012010 s

how can i do that using grep or any other commands?

© Super User or respective owner

Related posts about linux

Related posts about find