Sort remove duplicates issue Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AHKStudent
Posts: 1472
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 18 times
User avatar
mikeyww
Posts: 26945
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: 1769
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: 26945
Joined: 09 Sep 2014, 18:38

Re: Sort remove duplicates issue

29 Nov 2020, 12:47

Nice! Thank you, @malcev.
AHKStudent
Posts: 1472
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 (v1)”

Who is online

Users browsing this forum: Araphen, Descolada, Oblomov228 and 170 guests