A question on cut

hi, I used cut to get the
I have a file f1 with content:

         101.2 ms        RTT from 3WHS
          95.2 ms        RTT from 3WHS
          97.3 ms        RTT from 3WHS
          97.4 ms        RTT from 3WHS
         122.2 ms        RTT from 3WHS
         103.5 ms        RTT from 3WHS
          94.3 ms        RTT from 3WHS
          94.0 ms        RTT from 3WHS
         118.8 ms        RTT from 3WHS
          27.9 ms        RTT from 3WHS

I want to get the numbers and so I used

cat f1|cut -d" " -f1

but I get nothing
how can I achieve my goal? thanks

It's easier with awk:

awk '{print $1}' f1
101.2
95.2
97.3
97.4
122.2
103.5
94.3
94.0
118.8
27.9

A messy way is to first remove multiple space characters such that the field separator can be a single space. Note that this still leaves a leading space character, so the numbers become field 2.

cat f1|tr -s ' '|cut -d' ' -f2
101.2
95.2
97.3
97.4
122.2
103.5
94.3
94.0
118.8
27.9
awk '{print $1}' file

Edit: Methyl was faster. :slight_smile: