The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-19-2008
scuderiaf1 scuderiaf1 is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 6
script help needed --- awk?

hello and thanks in advance.

I need to consolidate 2 records of data into 1 record.

here is a sample of the input:
------------------------------------------------------------------------------------------
totalcount fred thomas 99999.00 88888:00
total 77777.00
------------------------------------------------------------------------------------------
totalcount sally smither 99999.00 88888:00
total 77777.00 66666.00
------------------------------------------------------------------------------------------

Sample records are grouped within the '-------'. I need the data within the '---------' consolidated to look like the output format below

Fred, Thomas, 77777.00, 99999.00, 888888:00
Sally, Smither, 77777.00, 99999.00, 888888:00

Last edited by scuderiaf1; 06-21-2008 at 09:44 AM.. Reason: simplified the sample data