How do I use cut to separate by multiple whitespace?
212
votes
10
answers
189301
views
I have this input, which is displayed in columns. I would like to get the second last column with the numbers of this sample:
[ 3] 1.0- 2.0 sec 1.00 MBytes 8.39 Mbits/sec
[ 3] 2.0- 3.0 sec 768 KBytes 6.29 Mbits/sec
[ 3] 3.0- 4.0 sec 512 KBytes 4.19 Mbits/sec
[ 3] 4.0- 5.0 sec 256 KBytes 2.10 Mbits/sec
...
If I use
cut -d\ -f 13
I get
Mbits/sec
6.29
4.19
2.10
because sometimes there are additional spaces in between.
Asked by rubo77
(30435 rep)
Jan 17, 2014, 11:54 PM
Last activity: May 18, 2024, 09:05 PM
Last activity: May 18, 2024, 09:05 PM