I have a file like this:
< Dec 2, 2015 2:51:49 PM EST> <Error> <HTTP> <cphypprod1v..com>
<AnalyticProviderServices0> <[ACTIVE] ExecuteThread: '3' for queue:
'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel> <> <1449085909249> <BEA-
101017> <[ServletContext@462961596[app:bea_wls_deployment_internal
module:bea_wls_deployment_internal.war path:/bea_wls_deployment_internal spec-
version:null]] Root ServletException.
java.lang.OutOfMemoryError: GC overhead limit exceeded
>
< Dec 2, 2015 2:51:49 PM EST> <Warning> <RMI> <cphypprod1v.sherwin.com> <AnalyticProviderServices0> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'>
<<WLS Kernel>> <> <> <1449085909264> < BEA-080003> < RuntimeException thrown by
rmi server: javax.management.remote.rmi.RMIConnectionImpl.invoke
(Ljavax.management.ObjectName;Ljava.lang.String;Ljava.rmi.Marshal
>
I need to modify it so it looks like:
< Dec 2, 2015 2:51:49 PM EST> <Error> <HTTP> <cphypprod1v..com> <AnalyticProviderServices0> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel> <><1449085909249> <BEA-101017> <[ServletContext@462961596[app:bea_wls_deployment_internal module:bea_wls_deployment_internal.war path:/bea_wls_deployment_internal spec-version:null]] Root ServletException. java.lang.OutOfMemoryError: GC overhead limit exceeded >
< Dec 2, 2015 2:51:49 PM EST> <Warning> <RMI> <cphypprod1v.sherwin.com> <AnalyticProviderServices0> <[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'>
<<WLS Kernel>> <> <> < 1449085909264> < BEA-080003> < RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl.invoke (Ljavax.management.ObjectName;Ljava.lang.String;Ljava.rmi.Marshal >
Everything between <
and >
must be on the same line. How can I do this?
Best Answer
With
awk
If you want a blank line between each output, you can add an extra
\n
to theORS
i.e.(although this may also add a trailing blank line at the end of the file).