Introduction
Given you have a list containing e.g. dates and other sortable stuff. If you want to sort it you can take ParserMarket/SortText which sorts the text lexicographically. Sometimes, however, you might want to sort the text using the dates or numbers contained in the text. In this case, Sorter is for you.
In your text you mark invisible columns. In the preamble of the Sorter parser you specify
- the column delimiter: delimiter= (empty as default for text sort over the complete line)
- the column number you want to sort: column=1
- the column type, which might be text or date: column_type=text
- the sorting direction: sort_dir=up
- the date format: date_format=%Y-%m-%d
Example
{{{#!Sorter delimiter=|,column=2,column_type=date,date_format=%d.%m.%Y,sort_dir=down * | B | 1.1.2005 * | A | 1.2.2006 * | D | 4.1.2005 * | C | 5.4.2000
}}}
results in:
- A 1.2.2006
- D 4.1.2005
- B 1.1.2005
- C 5.4.2000