From d0bd3910730f7940a271fa475dac4eb6c4d46ef9 Mon Sep 17 00:00:00 2001
From: YourFriendlyNeighborhoodDealer <qminer@2girls1dj.com>
Date: Thu, 7 Mar 2019 08:50:55 +0100
Subject: [PATCH] Even more fancier merger output

---
 merger.js | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/merger.js b/merger.js
index 92090e7..7b34cab 100644
--- a/merger.js
+++ b/merger.js
@@ -160,6 +160,12 @@ function Main() {
 		PrintDB(item);
 	});
 
+	var olds = [];
+	if (dbs.length == 1) {
+		for ( let i = 0; i < dbs[0].length; i++)
+			olds.push(dbs[0].Subjects[i].length);
+	}
+
 	console.log("Parsed data count: " + dbs.length);
 	PrintLN();
 
@@ -170,7 +176,7 @@ function Main() {
 	var r = RemoveDuplicates(db);
 
 	console.log("RESULT:");
-	PrintDB(r);
+	PrintDB(r, olds);
 
 	utils.WriteFile(JSON.stringify(r), "newData");
 	console.log("File written!");
@@ -180,7 +186,7 @@ function PrintLN() {
 	console.log("------------------------------------------------------");
 }
 
-function PrintDB(r) {
+function PrintDB(r, olds) {
 	console.log("Data subject count: " + r.length);
 	var maxLength = 0;
 	for (var i = 0; i < r.length; i++) {
@@ -188,8 +194,6 @@ function PrintDB(r) {
 			maxLength = r.Subjects[i].Name.length;
 	}
 
-	console.log("MAXL" + maxLength);
-
 	for (var i = 0; i < r.length; i++) {
 		let line = i;
 		if (line < 10)
@@ -206,6 +210,17 @@ function PrintDB(r) {
 				line += " ";
 		}
 
+		if (olds && olds.length > 0) {
+			// TODO: check if correct row! should be now, but well...
+			if (olds[i] < 10)
+				line += " ";
+			if (olds[i] < 100)
+				line += " ";
+
+			line += olds[i];
+			line += " -> ";
+		}
+
 		if (r.Subjects[i].length < 10)
 			line += " ";
 		if (r.Subjects[i].length < 100)