티스토리 뷰

Show

Emacs Sorting Text

Hide Code 2016. 2. 2. 14:05

http://www.gnu.org/software/emacs/manual/html_node/emacs/Sorting.html

 

for Windows, M-x is ALT+x

 

M-x sort-lines

Divide the region into lines, and sort by comparing the entire text of a line. A numeric argument means sort into descending order.

 
M-x sort-paragraphs

Divide the region into paragraphs, and sort by comparing the entire text of a paragraph (except for leading blank lines). A numeric argument means sort into descending order.

 
M-x sort-pages

Divide the region into pages, and sort by comparing the entire text of a page (except for leading blank lines). A numeric argument means sort into descending order.

 
M-x sort-fields

Divide the region into lines, and sort by comparing the contents of one field in each line. Fields are defined as separated by whitespace, so the first run of consecutive non-whitespace characters in a line constitutes field 1, the second such run constitutes field 2, etc.

Specify which field to sort by with a numeric argument: 1 to sort by field 1, etc. A negative argument means count fields from the right instead of from the left; thus, minus 1 means sort by the last field. If several lines have identical contents in the field being sorted, they keep the same relative order that they had in the original buffer.

 
M-x sort-numeric-fields

Like M-x sort-fields except the specified field is converted to an integer for each line, and the numbers are compared. ‘10’ comes before ‘2’ when considered as text, but after it when considered as a number. By default, numbers are interpreted according to sort-numeric-base, but numbers beginning with ‘0x’ or ‘0’ are interpreted as hexadecimal and octal, respectively.

 
M-x sort-columns

Like M-x sort-fields except that the text within each line used for comparison comes from a fixed range of columns. See below for an explanation.

 
M-x reverse-region

Reverse the order of the lines in the region. This is useful for sorting into descending order by fields or columns, since those sort commands do not have a feature for doing that.

 

'Show' 카테고리의 다른 글

어떤 운영체제를 쓸 것인가?  (0) 2016.06.18
Mail Signature Generator  (0) 2016.06.18
Java SE APIs & Documentation  (0) 2014.08.18
VirtualBox Hyper-V VMware Workstation Parallels Host Key  (0) 2014.07.15
GDI+ GdiPlus & Outline Text  (0) 2010.03.21
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함