In Windows it is '\n' and on Unix it is '\r\n', which caused my database to have too many lines with not aligned correctly.
It was an easy fix: on opening the files I remove the last char from each line plus I replace each '\r' with '', so that I can use that line on each operating system the same. I also check on exit that the final database does indeed not have any '\r' in the middle of a line, and if it does, I replace them all with '' and rewrite the lines in the file.
On the Unix machine the program runs under 4 hours (3 hrs and 22 minutes) when the output is redirected to a file (called LOG.txt), thus it is much faster than on my machine.
Now I just need a driver for my program that takes the arguments and flags from the command line and modifies the internal variables of my program. That shouldn't be very hard, I'll do it during finals week or so.
No comments:
Post a Comment