delete some columns

I've got a data file like the following format.

196004010000 196004020000 8192 24 ueaag 98.793 18.750 20 ---- - 36 23 9999 314.161773681641
196004020000 196004030000 8192 24 ueaag 98.793 18.750 20 ---- - 36 23 9999 314.71533203125
196004030000 196004040000 8192 24 ueaag 98.793 18.750 20 ---- - 36 23 9999 315.208740234375

I need the first and last column as

196004010000 314.161773681641
196004020000 314.71533203125
196004030000 315.208740234375

Would you have any idea to do this job? I'd be grateful with any help.

Many thanks,
su_in99

su,
See if this would work for you:

cut -d' ' -f1,14 input_file

Thank you for your quick reply.

But If I would like to save the new file, could you please tell me?

Many thanks indeed

su_in99

Here it is:

cut -d' ' -f1,14 input_file > output_file

sorry but I've got the wrong column. I need the first and last column.

196004010000 18.750
196004010000 18.750
196004010000 18.750

Many thanks,
S

su,
The solution I gave to you does work with the sample data you gave here.
You must be not be using exactly the solution I purposed or you are using
a different file layout from what is here.

Thank you very for your code.
:slight_smile:

awk ' { print $1,$NF } ' filename