cut lines in a file.

Hi Everyone,
I have a file a.txt, inside is
Mon Jul 20 00:05:07 2009 12
Mon Jul 20 00:05:08 2009 1

The output should be a.txt, inside is
00:05:07 12
00:05:08 1

My method is

`cat a.txt | cut -f4,6 -d' ' > a.txt.tmp;mv -rf a.txt.tmp a.txt`;

Is any good way to do this? like perl directly or awk.

Thanks

try this

awk '{print $4,$6}' file

Thanks :),

But the issue is, i attached my a.txt.
I can copy those two lines from a.txt into the excel file, so the last field in a.txt can be pasted into another column (field) in the excel file.

by running awk '{print $4,$6}' file, will cause then pasted into one column (field) in the excel file.

Please advice.

Thanks

redirect your output to a .csv file

I did:

awk '{print $4,"\t",$6}' a.txt

yes i think the default delimiter in csv is "tab"