On forums, we do encourage users to add their efforts which they have put in order to solve their own problems in their questions. So kindly do so and let us know, since we all are here to learn, cheers.
thanks R.Singh.
I tried to use awk to archive this, but it doesn't work as I have very limited knowledge.
below is my code. my thought is: first read section into ARRAY, then read next line; then print array value and the line together.
my os is: SunOS 5.10 Generic_150400-64 sun4v sparc sun4v
Thanks R.Singh. it works as expected.
one more question, I want to count total number of lines and put total number at end of the record. I don't know how to hold all the lines and print at end of each section. I tried below codes, no luck .
what I thought is to use array line to hold each line, at end, print the line and number. but it doesn't work like that.