You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> line by line diff of two large (sorted) text files
4
4
5
-
You need a nodejs tool to diff two large text files. This is also useful with csv files:
5
+
This is especially useful with csv/tsv/psv files:
6
6
- compare products file for changes to import
7
7
- compare log files
8
-
- compare database of employee/users
8
+
- compare database export of large organization employee/users
9
9
10
10
## NOTE
11
11
12
-
This script expect input of two `sorted` text files. If the file is not sorted, the unix `sort` command may be of help: https://en.wikipedia.org/wiki/Sort_(Unix)
12
+
This script expect input of two `sorted` text files. If the files are not sorted, the unix `sort` command may be of help: https://en.wikipedia.org/wiki/Sort_(Unix)
13
+
14
+
> ForEach line in File1, compare to line in File2
15
+
> equal: incr both files to next line
16
+
> line1 > line2: new line detected, incr File2 to next line
17
+
> line1 < line2: deleted line, incr File1 to next line
18
+
19
+
Since the list will be `sorted`, the performance of this script is expected to be approximately `O(|A| log |A| + |B| log |B|)`, where A is File1 and B is File2.
0 commit comments