Computing: Free Pascal Programming

Simple text file merge program.


Download tmerge console program (Windows 64bit) Download tmerge source code (Lazarus/Free Pascal)

Description: Simple command line program, that may be used to merge text files. The program takes as input several text files and produces as output another text file, with the lines of all the input files and these 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.

Note for programmers: The program doesn't contain any merge algorithm. In fact, it reads the lines of all input files and appends them within a temporary file, which is then sorted to create the output file.

Free Pascal features: Recursion. Quick Sort algorithm. Using the functions of the LazUTF8 unit with command line programs. Reading, writing and appending text files.

Screenshot:

Merging two text files on sort keys at line position 1-3 and 7-40

If you like this program, please, support me and this website by signing my guestbook.