COMPUTER SCIENCE AND ENGINEERING
UNIX
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
how to sort according to the 4th character of the 3rd column of a file in decreasing order?
|
sort-t3, 4 file
|
|
sort-r-d3, 4 file
|
|
sort-k3, 4-r file
|
|
sort file
|
Explanation:
Detailed explanation-1: -Select a cell in the column you want to sort. On the Data tab, in the Sort & Filter group, click Sort. In the Sort dialog box, under Column, in the Sort by box, select the column that you want to sort.
Detailed explanation-2: -Columns or fields Use the-k option to sort on a certain column. For example, use “-k 2 “ to sort on the second column.
Detailed explanation-3: -To sort a file containing numeric data, use the-n flag with the command. By default, sort will arrange the data in ascending order. If you want to sort in descending order, reverse the arrangement using the-r option along with the-n flag in the command.
There is 1 question to complete.