Help with sorting a file
Hi there,
I would like to ask how I could sort this nam input file; Code:
+ 2.47 4 3 cbr 500 ------- 3 4.0 1.1 294 989 Code:
+ 2.472 3 5 cbr 500 ------- 1 0.0 5.0 233 600 Yogiz |
Use sort(1) utility
|
If the number of columns is fixed, e.g. each rows have always 12 fields, you can use sort with option -k to specify the position of the field to be sorted:
Code:
sort -n -k 12 input_file |
Awsome thanks for that.
How would I go on about then extracting just the first column into a new file? |
Awsome thanks for that.
How would I go on about then extracting just the second column into a new file? For example; 2.472 2.47 2.471 2.47 2.47 |
Got it used
awk '{print $2}' filename > output Love Linux |
All times are GMT -5. The time now is 05:21 AM. |