Comparing lists
Comparing lists
Hey guys!
I'm trying to compare lists generating three files as outputs, splitting uniques and commom from each. But the script stales at a point and I'm not sure why? Please help. Attached the code I'm using for this.
list 1
(Not Escape Room)
.dungeon
/dia
[ENDLESS_OVERDRIVE]
[Inkbit] Pixel Art Font Set
[MOOD] Pixel Art Font Set
[New Hi-Score] Pixel Art Font
[Speer]
list 2
(Not Escape Room)
.dungeon
/dia
commom 1
[ENDLESS_OVERDRIVE]
commom 2
[MOOD] Pixel Art Font Set
[New Hi-Score] Pixel Art Font
I'm trying to compare lists generating three files as outputs, splitting uniques and commom from each. But the script stales at a point and I'm not sure why? Please help. Attached the code I'm using for this.
list 1
(Not Escape Room)
.dungeon
/dia
[ENDLESS_OVERDRIVE]
[Inkbit] Pixel Art Font Set
[MOOD] Pixel Art Font Set
[New Hi-Score] Pixel Art Font
[Speer]
list 2
(Not Escape Room)
.dungeon
/dia
commom 1
[ENDLESS_OVERDRIVE]
commom 2
[MOOD] Pixel Art Font Set
[New Hi-Score] Pixel Art Font
- Attachments
-
- comparelists.xys
- (996 Bytes) Downloaded 82 times
Power-hungry user!!!
Re: Comparing lists
Here,
[Speer]
is listed as common, which is not.
[MOOD] Pixel Art Font Set
[New Hi-Score] Pixel Art Font
are under "unique on list 2", but they are common to both lists.
[Speer]
is listed as common, which is not.
[MOOD] Pixel Art Font Set
[New Hi-Score] Pixel Art Font
are under "unique on list 2", but they are common to both lists.
Power-hungry user!!!
Re: Comparing lists
Sorry, but you really can't find out why this happens?
A hint: NO WILDCARDS^^
A hint: NO WILDCARDS^^
One of my scripts helped you out? Please donate via Paypal
Re: Comparing lists
"no wildcards" makes the [ENDLESS_OVERDRIVE] and (Not Escape Room) entries be listed as "unique", they aren't.
Any way to solve this?
Any way to solve this?
Power-hungry user!!!
Re: Comparing lists
Without knowing what you've changed in the script? Nope^^
One of my scripts helped you out? Please donate via Paypal
Re: Comparing lists
I just removed the "w" parameter as indicated for the gettokenindex command...
Power-hungry user!!!
Re: Comparing lists
Show the full script...
One of my scripts helped you out? Please donate via Paypal
Re: Comparing lists
$now = formatdate(, "yyyy_mm_dd_hhnnss");
$name = "compared List_" . "$now";
$name1 = "$name" . "_unique On List 1";
$name2 = "$name" . "_unique On List 2";
$name3 = "$name" . "_COMMON";
echo "Copy the FIRST source list to the clipboard and press OK!";
$listA = "<clipboard>" . "<crlf>";
echo "Now copy the SECOND list to the clipboard, then press OK!";
$listB = "<clipboard>" . "<crlf>";
step;
foreach($tk, "$listA", "<crlf>") {
$tst = gettokenindex(trim("$tk", "<tab> "), "$listB", "<crlf>", i);
if("$tst" == 0) { writefile("$name1" . ".txt", "$tk<crlf>", a, tu); }
else { writefile("$name3" . ".txt", "$tk<crlf>", a, tu); }
}
step;
foreach($tk, "$listB", "<crlf>") {
$tst = gettokenindex(trim("$tk", "<tab> "), "$listA", "<crlf>", i);
if("$tst" == 0) { writefile("$name2" . ".txt", "$tk<crlf>", a, tu); }
else { }
}
echo "done";
$name = "compared List_" . "$now";
$name1 = "$name" . "_unique On List 1";
$name2 = "$name" . "_unique On List 2";
$name3 = "$name" . "_COMMON";
echo "Copy the FIRST source list to the clipboard and press OK!";
$listA = "<clipboard>" . "<crlf>";
echo "Now copy the SECOND list to the clipboard, then press OK!";
$listB = "<clipboard>" . "<crlf>";
step;
foreach($tk, "$listA", "<crlf>") {
$tst = gettokenindex(trim("$tk", "<tab> "), "$listB", "<crlf>", i);
if("$tst" == 0) { writefile("$name1" . ".txt", "$tk<crlf>", a, tu); }
else { writefile("$name3" . ".txt", "$tk<crlf>", a, tu); }
}
step;
foreach($tk, "$listB", "<crlf>") {
$tst = gettokenindex(trim("$tk", "<tab> "), "$listA", "<crlf>", i);
if("$tst" == 0) { writefile("$name2" . ".txt", "$tk<crlf>", a, tu); }
else { }
}
echo "done";
Power-hungry user!!!
Re: Comparing lists
Not here...[ENDLESS_OVERDRIVE] and (Not Escape Room) entries be listed as "unique"
Code: Select all
compared List_2022_03_23_215101_COMMON.txt
(Not Escape Room)
.dungeon
/dia
[ENDLESS_OVERDRIVE]
[MOOD] Pixel Art Font Set
[New Hi-Score] Pixel Art Font
Code: Select all
compared List_2022_03_23_215101_unique On List 1.txt
[Inkbit] Pixel Art Font Set
[Speer]
Code: Select all
compared List_2022_03_23_215101_unique On List 2.txt
commom 1
commom 2
One of my scripts helped you out? Please donate via Paypal
Re: Comparing lists
My guess:
At least one list has at least 1 entry, that is indented (by either space(s) or tab(s) / a mix of them)...
At least one list has at least 1 entry, that is indented (by either space(s) or tab(s) / a mix of them)...
One of my scripts helped you out? Please donate via Paypal