Sort remove duplicates issue Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
AHKStudent
Posts: 1021
Joined: 05 May 2018, 12:23

Sort remove duplicates issue

29 Nov 2020, 12:13

Hi

After you download the text file please run this code. It is not removing duplicates because of hidden text, is there a way to clean a text file before running sort?

Code: Select all

FileRead, t, ahktestfile.txt
sort, t, U
msgbox, % t
ExitApp
Attachments
ahktestfile.txt
(22 Bytes) Downloaded 13 times
User avatar
mikeyww
Posts: 4108
Joined: 09 Sep 2014, 18:38

Re: Sort remove duplicates issue

29 Nov 2020, 12:25

Code: Select all

FileRead, t, ahktestfile.txt
t := StrReplace(t, "`r", "`n")
sort, t, U
msgbox, % t
ExitApp
malcev
Posts: 834
Joined: 12 Aug 2014, 12:37

Re: Sort remove duplicates issue  Topic is solved

29 Nov 2020, 12:32

Code: Select all

FileRead, t, *t ahktestfile.txt
User avatar
mikeyww
Posts: 4108
Joined: 09 Sep 2014, 18:38

Re: Sort remove duplicates issue

29 Nov 2020, 12:47

Nice! Thank you, @malcev.
AHKStudent
Posts: 1021
Joined: 05 May 2018, 12:23

Re: Sort remove duplicates issue

29 Nov 2020, 12:50

thank you both :thumbup: :thumbup: never understood the *t option in the documentation, appreciate it @malcev

Return to “Ask For Help”

Who is online

Users browsing this forum: Rohwedder, Spawnova, XMCQCX and 52 guests