Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Forget regular expressions. You should just chew through each stream. Advancing and sorting matches as you can. Some pseudo code:</p> <pre><code>Using Streams A and B, and Objects Match and NoMatch FETCH next Line of A into LineA FETCH next Line of B into LineB WHILE Neither stream is at end of file: WHILE TimeStamp in LineA &lt; TimeStamp in LineB: ADD LineA to NoMatch FETCH next Line of A into LineA WHILE TimeStamp in LineA = TimeStamp in LineB: Add (LineA, LineB) to Match FETCH next Line of A into LineA FETCH next Line of B into LineB WHILE A is not at End of File ADD LineA to NoMatch FETCH next Line of A into LineA </code></pre> <p>This will handle repeats in A, but not in B. To handle repeats in B, you have to maintain memory of past lines:</p> <pre><code>Using Streams A and B, and Objects Match, NoMatch and Temp FETCH next Line of A into LineA FETCH next Line of B into LineB WHILE Neither stream is at end of file: CLEAR Temp WHILE TimeStamp in LineA &lt; TimeStamp in LineB: ADD LineA to NoMatch FETCH next Line of A into LineA WHILE TimeStamp in LineA = TimeStamp in LineB: ADD (LineA, LineB) to Match ADD LineA to Temp SET Temp Timestamp to LineA Timestamp FETCH next Line of A into LineA FETCH next Line of B into LineB WHILE TimeStamp in LineB = Temp TimeStamp: FOR Line IN Temp: ADD (Line, LineB) TO Match FETCH next Line of B into LineB WHILE A is not at End of File ADD LineA to NoMatch FETCH next Line of A into LineA </code></pre> <p>EDIT: I was ambiguous about how to determine EOF. Let us presume that reading after EOF returns and empty string (as it does in python). Implementation works more like this:</p> <pre><code>Using Streams A and B, and Objects Match, NoMatch and Temp FETCH next Line of A into LineA FETCH next Line of B into LineB WHILE Neither LineA nor LineB is an Empty String: CLEAR Temp WHILE LineA is not an Empty String, AND TimeStamp in LineA &lt; TimeStamp in LineB: ADD LineA to NoMatch FETCH next Line of A into LineA WHILE LineA is not an Empty String, AND TimeStamp in LineA = TimeStamp in LineB: ADD (LineA, LineB) to Match ADD LineA to Temp SET Temp Timestamp to LineA Timestamp FETCH next Line of A into LineA FETCH next Line of B into LineB WHILE LineB is not an Empty String, AND TimeStamp in LineB = Temp TimeStamp: FOR Line IN Temp: ADD (Line, LineB) TO Match FETCH next Line of B into LineB //At this point, Either LineA is empty (meaning there are no more strings to match), //or LineB is empty (meaning there are no more matches to find). If the first is true, //This loop will be skipped. Otherwise, this loop will put what's left of A into the //Not Matched Object. WHILE LineA is not an Empty String: ADD LineA to NoMatch FETCH next Line of A into LineA </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload