I learned Pascal a long time ago and peaked as a hobbyist programmer with Delphi 5. I now need to create a program to merge two text files. One contains results from a testing application and the other is downloaded from our Learning management system (LMS).
I want to read both files into TStringLists, merge them, and display them in a TStringGrid to confirm the merge has worked, then write the results to a tab delimited file.
The problem is, the files from the LMS are tab delimited, with quoted strings and unix (LF) line endings and I cannot figure out how to read them properly.
As a workaround, I tried to read in the file, convert it to CRLF line endings and write it out to a temp file. This creates a file where every second line is gibberish. I have tried using TextFiles, LoadFromFile, TStreams and CSVDocument. I Even downloaded the Delphi-based FileFixUp, which is supposed to correct line endings. It produces the same gibberish every second line.
Can anyone suggest code to convert sample_tab_file to a CRLF file, correctly? I attach it and the sample output from FileFixUP, which is the same as the output from all my unsuccessful attempts at creating the code.