A log file monitoring software, the content is as follows:
Date/time interface equipment state
The 2016-09-01 08:00 J1 D1 Down
The 2016-09-01 08:15 J2 D2 Down
The 2016-09-01 08:26 J1 D1 Up
The 2016-09-01 GMT J2 D2 Up
.
Now need to analyze the log file by the program, get the following contents:
Date time to recover time interface equipment
The 2016-09-01 08:00 08:26 J1 D1
The 2016-09-01 08:18 09:00 J2 D2
.
This what to do???
CodePudding user response:
You are so specification this data Create a TextFile Loading text document Analysis of string in the database (copy command truncated string) Database filter
CodePudding user response:
Key point is to design a structure to save the result, Such as use a TStringList + TResult, This TResult is your design class, the class contains interface, equipment, date, start time, end time attributes, such as
The next line analysis, storing the results of the analysis to the TStringList + TResult,
Finally, taking out TStringList + TResult results, forming the format you want,