This is comparable to another question I have requested here on SO, but it is different enough from this which i weren't in a position to develop a solution for this by myself yet. I believe the easiest method to introduce my issue is having a picture:

example

I've several text files (4 within this example), each with countless lines of information within the following format:

TIME DATA

File #1
104500 4098
104501 34098
104502 1321
104502 3408
104503 4587
104503 1204
104503 49858
104504 1029
104505 4058
104506 7576

File #2
104500 23408
104500 2131
104501 5686
104502 6839
104502 21838
104503 86760
104503 20812
104503 85719
104504 4877
104505 2220
104506 4847

File #3
104500 23042
104501 12391
104501 5857
104501 6979
104502 2196
104502 21039
104503 9263
104503 50573
104503 18361
104504 17545
104505 67612
104506 21075

File #4
104500 1193
104501 8664
104502 1028
104502 68561
104503 69178
104503 1230
104503 12048
104504 8843
104505 9910
104506 53978
104506 13722

However , confirmed amount of time in one file might have pretty much data records of computer has in another file. Within the picture above for instance, there's just one entry for 10:45:00 in File #1, but you will find two records for 10:45:00 in File #2. I am wishing to obtain each file to achieve the equivalent lines per time entry, so during my example with Files #1 and #2, a 'filler' line could be added following the the very first '104500 4098' line, which filler line would certainly be a precise copy from the line above it (104500 4098 within this situation). Ideally these 'filler' lines could be placed in to the text files being read from, and never written to a different text file.

What I have develop to date is the fact that I have to:

--count the amount of lines for every with time

--find which file has got the greatest quantity of lines for every with time

--place the 'filler' line(s) in every file where necessary

Regrettably I do not really understand how to inflict of this. I've ideas, but they are all vague at this time and so i don't fully realize things i should educate yourself on yet. Really the only code that I have develop to date is will be able to assign all files within the directory for an array using Directory.GetFiles, and that i may then loop through all of the files this way, but that does not get me very far.

Wrinkles of information are produced with a program, which in turn creates the lines to text files. I do not have the code which creates the lines of information.

If anybody has any ideas regarding the way i might make this happen, an indication could be much appreciated.