Computing: Free Pascal Programming

Programming Home   Home   Contact

Simple text file sort program (tsort).


Description: Simple command line program, that may be used to sort text files. The program takes as input a text file and produces as output another text file, with its lines sorted depending on the command line parameters. Beside simple sorts (alphabetically ordering the lines of the file), the program also allows to sort the lines, based on one or several sort keys, these sort keys corresponding to the text contained in a given column, i.e. the text at a given position within the line. This works, of course only, if the text data is organized in columns with fixed positions (and these columns being separated by spaces). Cf. the readme file, included in the download archive, for more information.

Version history:
  Version 1.0 (October 2020): Original program
  Version 2.0 (November 2020): Addition of further sort options:
    - Allowing header lines (not to be sorted)
    - Removal of duplicate lines
    - Selection of how to sort letters with accents

Free Pascal features: Reading and writing text files (classic Pascal). Using the functions of the LazUTF8 unit with command line programs.

Screenshot:

Sorting a text file on a sort key at line position 76-105