I have a textfile named table1.txt and I want to write the records in one line. If the next line do not have any date before the line or there is a blank, this line should be paste on the first line. I would appreciate any help in solving this problem. I tried to do this, but not working
I need the records to be written this way:
Code:
tr -s " " table1.txt > notab.txt
Code:
06/15/2007 02:28:47 TABLE "nmmp_" - 18,015,000 BYTES, 342,712 ROWS
ARCHIVED FOR THIS STREAM
06/15/2007 02:28:47
06/15/2007 02:28:47 STREAM TOTALS:
06/15/2007 02:28:47 TABLE "dsd_zation" - 8,711,188,670 BYTES,
150,192,895 ROWS ARCHIVED TOTAL
06/15/2007 02:28:47 TABLE "lu_upc" - 317,632,067 BYTES, 1,200,084 ROWS
ARCHIVED TOTAL
06/15/2007 02:28:47 TABLE "lu_upc_usa" - 229,112,147 BYTES, 865,803 ROWS
ARCHIVED TOTAL
06/15/2007 02:28:22 TABLE "dsd_zation" - 4,355,943,498 BYTES,
75,102,461 ROWS ARCHIVED FOR THIS STREAM
06/15/2007 02:28:35 TABLE "lu_xxx" - 158,866,056 BYTES, 600,190 ROWS ARCHIVED
FOR THIS STREAM
Code:
[small]
06/15/2007 02:28:47 TABLE "nmmp_" - 18,015,000 BYTES, 342,712 ROWS ARCHIVED FOR THIS STREAM
06/15/2007 02:28:47
06/15/2007 02:28:47 STREAM TOTALS:
06/15/2007 02:28:47 TABLE "dsd_zation" - 8,711,188,670 BYTES, 150,192,895 ROWS ARCHIVED TOTAL
06/15/2007 02:28:47 TABLE "lu_upc" - 317,632,067 BYTES, 1,200,084 ROWS ARCHIVED TOTAL
06/15/2007 02:28:47 TABLE "lu_upc_usa" - 229,112,147 BYTES, 865,803 ROWS ARCHIVED TOTAL
06/15/2007 02:28:47 TABLE "dsd_zation" - 4,355,943,498 BYTES, 75,102,461 ROWS ARCHIVED FOR THIS STREAM
06/15/2007 02:28:47 TABLE "lu_xxx" - 158,866,056 BYTES, 600,190 ROWS ARCHIVED FOR THIS STREAM
[/small]