removing particular lines ending with a .cnt extension in a text file

I have a text file with rows of information (it is basically a ls command information(o/p from ls command))
I need to remove the lines ending with a .cnt extension and keep the lines ending with .zip extension, how to accomplish this.
I also only need the date,size and name of the file from every row, i want to get rid of the permissions column at the first how do i accomplish this. any help is appreciated.

my file is a.txt its contents are
-rwx---rwx may 10 2007 236748629 d_lst_tst.cnt
-rwxrwxrwx may 12 2007 376864923 d_lst_tet.zip
-rwx-wx-wx may 12 2007 480527935 d_ink_let.cnt
----rwxrwx may 12 2007 367859629 f_ink_let.zip

I want to remove the first and third line from my text file and also want to remove the "rwx" part from the second and fourth lines how to do this.

Try this:

# cat /tmp/tmp
-rwx---rwx may 10 2007 236748629 d_lst_tst.cnt
-rwxrwxrwx may 12 2007 376864923 d_lst_tet.zip
-rwx-wx-wx may 12 2007 480527935 d_ink_let.cnt
----rwxrwx may 12 2007 367859629 f_ink_let.zip
# grep -v \.cnt$ /tmp/tmp | cut -d' ' -f2-
may 12 2007 376864923 d_lst_tet.zip
may 12 2007 367859629 f_ink_let.zip

There is sure to be a way to do this in a single command, but I'm not really up to it at the moment :slight_smile:

Another way:

awk '/zip$/{print $2,$3,$4,$5}' file

Regards