I have created a data file and would like to pull specific info out..
Here's how the file looks like
#----------------- cut here -----------------#
mm/dd/yyyy
<blank_line>
amount
client1 data_amount
client2 data_amount
client3 data_amount
client4 data_amount
client5 data_amount
client6 data_amount
<blank_line>
speed
client1 data data data speed kb/s data
client2 data data data speed kb/s data
client3 data data data speed kb/s data
client4 data data data speed kb/s data
client5 data data data speed kb/s data
client6 data data data speed kb/s data
<blank_line>
mm/dd/yyyy
<blank_line>
amount
client1 data_amount
client2 data_amount
client3 data_amount
client4 data_amount
client5 data_amount
client6 data_amount
<blank_line>
speed
client1 data data data speed kb/s data
client2 data data data speed kb/s data
client3 data data data speed kb/s data
client4 data data data speed kb/s data
client5 data data data speed kb/s data
client6 data data data speed kb/s data
<blank_line>
mm/dd/yyyy
<blank_line>
amount
client data_amount
client data_amount
client data_amount
client data_amount
client data_amount
client data_amount
<blank_line>
speed
client data data data speed kb/s data
client data data data speed kb/s data
client data data data speed kb/s data
client data data data speed kb/s data
client data data data speed kb/s data
client data data data speed kb/s data
<blank_line>
#----------------- cut here -----------------#
There would be up to two weeks of data in the file. Each days data is seperated with "mm/dd/yyyy"
I would like to generate 2 reports that looks like:
ClientX mm/dd/yyyy mm/dd/yyyy mm/dd/yyyy mm/dd/yyyy
client1 data_amount data_amount data_amount data_amount
client2 data_amount data_amount data_amount data_amount
client3 data_amount data_amount data_amount data_amount
client4 data_amount data_amount data_amount data_amount
client5 data_amount data_amount data_amount data_amount
client6 data_amount data_amount data_amount data_amount
ClientX mm/dd/yyyy mm/dd/yyyy mm/dd/yyyy mm/dd/yyyy
client1 speed speed speed speed
client2 speed speed speed speed
client3 speed speed speed speed
client4 speed speed speed speed
client5 speed speed speed speed
client6 speed speed speed speed
data_amount = a number representing amount of data backed up
speed = a number representing speed in kb/s
how would I do this with awk?
Thanks......
Joe Despres
Here's how the file looks like
#----------------- cut here -----------------#
mm/dd/yyyy
<blank_line>
amount
client1 data_amount
client2 data_amount
client3 data_amount
client4 data_amount
client5 data_amount
client6 data_amount
<blank_line>
speed
client1 data data data speed kb/s data
client2 data data data speed kb/s data
client3 data data data speed kb/s data
client4 data data data speed kb/s data
client5 data data data speed kb/s data
client6 data data data speed kb/s data
<blank_line>
mm/dd/yyyy
<blank_line>
amount
client1 data_amount
client2 data_amount
client3 data_amount
client4 data_amount
client5 data_amount
client6 data_amount
<blank_line>
speed
client1 data data data speed kb/s data
client2 data data data speed kb/s data
client3 data data data speed kb/s data
client4 data data data speed kb/s data
client5 data data data speed kb/s data
client6 data data data speed kb/s data
<blank_line>
mm/dd/yyyy
<blank_line>
amount
client data_amount
client data_amount
client data_amount
client data_amount
client data_amount
client data_amount
<blank_line>
speed
client data data data speed kb/s data
client data data data speed kb/s data
client data data data speed kb/s data
client data data data speed kb/s data
client data data data speed kb/s data
client data data data speed kb/s data
<blank_line>
#----------------- cut here -----------------#
There would be up to two weeks of data in the file. Each days data is seperated with "mm/dd/yyyy"
I would like to generate 2 reports that looks like:
ClientX mm/dd/yyyy mm/dd/yyyy mm/dd/yyyy mm/dd/yyyy
client1 data_amount data_amount data_amount data_amount
client2 data_amount data_amount data_amount data_amount
client3 data_amount data_amount data_amount data_amount
client4 data_amount data_amount data_amount data_amount
client5 data_amount data_amount data_amount data_amount
client6 data_amount data_amount data_amount data_amount
ClientX mm/dd/yyyy mm/dd/yyyy mm/dd/yyyy mm/dd/yyyy
client1 speed speed speed speed
client2 speed speed speed speed
client3 speed speed speed speed
client4 speed speed speed speed
client5 speed speed speed speed
client6 speed speed speed speed
data_amount = a number representing amount of data backed up
speed = a number representing speed in kb/s
how would I do this with awk?
Thanks......
Joe Despres