Lines & ListsLesson 357Free preview
Sort Lines
This lesson is part of Web Developer Tools · All levels
Summary
Sort Lines sort lines of text based on their contents, either alphabetically, numerically, or according to a particular arrangement. The alphabetical order compares characters by characters, so that "10" can appear before "2". Options like case-insensitive, reverse, and numeric help to tailor the results to the data type.
Key points
- Alphabet sort compares the text of each character
- Sort -n is used for numerical order
- Sort -r reverses the order to decline
- Sort -f ignores the difference between capital and capital
- The spaces at the beginning of the line can affect the sequencing results
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.