Formatting of output

Hi Experts,

I have to create a report for certain audit and my output looks as follows

I m trying to format my output to look like

Any inputs would be highly appreciated

Thanks
Syed

This is what are you looking for ?

awk '/^dependency/{printf "\n"$0FS}/^provider/{print $0}' inputfile

Sorry Praveen, it is not working

Let us know the error are you receiving. It's working at my end. see below.

#cat dependncy
Finding dependencies:
package: popt.x86_64 1.10.2.3-18.el5
dependency: libc.so.6(GLIBC_2.3.4)(64bit)
provider: glibc.x86_64 2.5-49
provider: glibc.x86_64 2.5-49
dependency: libpopt.so.0()(64bit)
provider: popt.x86_64 1.10.2.3-18.el5
dependency: libc.so.6(GLIBC_2.4)(64bit)
provider: glibc.x86_64 2.5-49
provider: glibc.x86_64 2.5-49
#  awk '/^dependency/{printf "\n"$0FS}/^provider/{print $0}' dependncy

O/P

dependency: libc.so.6(GLIBC_2.3.4)(64bit) provider: glibc.x86_64 2.5-49
provider: glibc.x86_64 2.5-49

dependency: libpopt.so.0()(64bit) provider: popt.x86_64 1.10.2.3-18.el5

dependency: libc.so.6(GLIBC_2.4)(64bit) provider: glibc.x86_64 2.5-49
provider: glibc.x86_64 2.5-49

Thank you praveen it works, I had a problem with the spaces in the start, I had to tweak the command a bit as follows

awk '/^  dependency/{printf "\n"$0FS}/^   provider/{print $0}'

How to further process so that we have all in same line like

dependency: libc.so.6(GLIBC_2.3.4)(64bit) provider: glibc.x86_64 2.5-49 provider: glibc.x86_64 2.5-49

I would like this as Im planning to use ":" or something else as a feild seperator and then mail this as a cvs attachment.

Thanks in Advance
Syed

awk '/dependency:/||/provider:/ {printf (/provider:/? FS $0: RS $0)}' infile

dependency: libc.so.6(GLIBC_2.3.4)(64bit) provider: glibc.x86_64 2.5-49 provider: glibc.x86_64 2.5-49
dependency: libpopt.so.0()(64bit) provider: popt.x86_64 1.10.2.3-18.el5
dependency: libc.so.6(GLIBC_2.4)(64bit) provider: glibc.x86_64 2.5-49 provider: glibc.x86_64 2.5-49