I have a text file named tmp4.txt with sample records:
I need the file tmp4.txt to look like this:
Basically, how do i remove the second and third fields and the words after the numbers? That is remove the date, time, the word BYTES, and remove the word ROWS and after that.
To start with, here's my code that removes the word "BYTES,"
Highly appreciate your suggestions. Thanks.
Code:
MISC_INT 05/30/2007 12:14:20 TABLE xx_httj 4,150 BYTES, 63 ROWS ARCHIVED FOR THIS
STORE_INT 05/30/2007 12:14:22 VIEW fret_xxfe 6,392,925 BYTES, 182,655 ROWS
STORE_INT 05/30/2007 12:14:25 TABLE bkup_x 4,756,990 BYTES, 135,914 ROWS
STORE_INT 05/30/2007 12:14:27 TABLE dsakj_djjsa 7,584 BYTES, 16 ROWS ARCHIVED
STORE_INT 05/30/2007 12:14:29 VIEW pll_xxx_excpalddc 49 BYTES, 1 ROWS ARCHIVED FOR
STORE_INT 05/30/2007 12:14:30 TABLE ldasd_sads_ssss_xxxx 0 BYTES, 0 ROWS ARCHIVED
Code:
MISC_INT TABLE xx_httj 4,150 63
STORE_INT VIEW fret_xxfe 6,392,925 182,655
STORE_INT TABLE bkup_x 4,756,990 135,914
STORE_INT TABLE dsakj_djjsa 7,584 16
STORE_INT VIEW pll_xxx_excpalddc 49 1
STORE_INT TABLE ldasd_sads_ssss_xxxx 0 0
To start with, here's my code that removes the word "BYTES,"
Code:
sed "s/"BYTES,"/ /g" tmp4.txt