iamtheky Posted May 11, 2015 Share Posted May 11, 2015 (edited) So if a reasonable amount of the leading characters in a name, match the previous, then group them? You could probably also read the nzb, nfo, diz... as they usually contain the common string found in the names. expandcollapse popup#include <File.au3> #include <MsgBoxConstants.au3> Global $aFileList[] = [25, _ "####### 12 v12.0.00800 MultiLingual Genial78.par2", _ "####### 12 v12.0.00800 MultiLingual Genial78.part1.rar", _ "####### 12 v12.0.00800 MultiLingual Genial78.part2.rar", _ "####### 12 v12.0.00800 MultiLingual Genial78.part3.rar", _ "####### 12 v12.0.00800 MultiLingual Genial78.vol00+01.PAR2", _ "####### 12 v12.0.00800 MultiLingual Genial78.vol01+02.PAR2", _ "####### 12 v12.0.00800 MultiLingual Genial78.vol03+04.PAR2", _ "####### 12 v12.0.00800 MultiLingual Genial78.vol07+08.PAR2", _ "####### 12 v12.0.00800 MultiLingual Genial78.vol15+13.PAR2", _ "~~~~~~~.v.1.40.208-TE.nfo", _ "~~~~~~~.v.1.40.208-TE.r00", _ "~~~~~~~.v.1.40.208-TE.r01", _ "~~~~~~~.v.1.40.208-TE.r02", _ "~~~~~~~.v.1.40.208-TE.r03", _ "~~~~~~~.v.1.40.208-TE.r04", _ "~~~~~~~.v.1.40.208-TE.r05", _ "~~~~~~~.v.1.40.208-TE.r06", _ "~~~~~~~.v.1.40.208-TE.rar", _ "~~~~~~~.v.1.40.nzb", _ "~~~~~~~.v.1.40.par2", _ "~~~~~~~.v.1.40.sfv", _ "~~~~~~~.v.1.40.vol00+1.PAR2", _ "~~~~~~~.v.1.40.vol01+2.PAR2", _ "~~~~~~~.v.1.40.vol03+4.PAR2", _ "~~~~~~~.v.1.40.vol07+6.PAR2"] ;~ Global $aFileList[] = [15, _ ;~ "file_id.diz" , _ ;~ "tapcla01.zip" , _ ;~ "tapcla02.zip" , _ ;~ "tapcla03.zip" , _ ;~ "tapcla04.zip" , _ ;~ "tapcla05.zip" , _ ;~ "tapcla06.zip" , _ ;~ "tapcla07.zip" , _ ;~ "te.nfo" , _ ;~ "tt55013a.zip" , _ ;~ "tt5013b.zip" , _ ;~ "tt55013c.zip" , _ ;~ "tt5013d.zip" , _ ;~ "tt5013e.zip"] local $aOut[1] For $i = 1 to ubound($aFileList) - 1 If $i = 1 Then $aOut[0] = $aFileList[$i] Else $length = StringLen($aFileList[$i]) If stringinstr($aOut[0] , stringleft($aFileList[$i] , floor($length / 2.8))) Then _ArrayAdd ($aOut , $aFileList[$i]) Else _ArrayDisplay($aOut) ReDim $aOut[1] $aOut[0] = $aFileList[$i] EndIf EndIf Next _ArrayDisplay($aOut) Edited May 11, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 11, 2015 Moderators Share Posted May 11, 2015 Chimaera,and show you an image of itPlease do not do that! Just send me the list as a text file or I have to read and retype each one.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 11, 2015 Moderators Share Posted May 11, 2015 boththose,Although I like your idea of stopping at the first "significant" increase in matches, I am not convinced that this would get every file of a family as the increase when a final trailing numeric character was removed might give a false positive. For example there could be an increase of 10 when ####1* is used to match, when there are 30+ ####* matches to come. And yet looking for over 10 more matches would fail if there were only 15 total to find. read the nzb, nfo, diz...I prefer that approach - but will those files types always be present?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
iamtheky Posted May 11, 2015 Share Posted May 11, 2015 True, if ultimately stuck brute forcing it there would have to be an additional step of normalizing the length with stringformat to have a prayer, and even then edgecases will abound. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Chimaera Posted May 11, 2015 Author Share Posted May 11, 2015 I prefer that approach - but will those files types always be present?M23Not usually no, sometimes but not enough to rely on.Just thinking out loud here could you split in chunks of four letters etcthen test by the chunk from the left rather than the letterOpen Clon er.Ul traB ox.v 1.40. 208- TEvery few files would match Open as a word? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
iamtheky Posted May 11, 2015 Share Posted May 11, 2015 probably still lots of ways to break it: expandcollapse popup#include <File.au3> #include <MsgBoxConstants.au3> Global $aFileList[] = [25, _ "####### 12 v12.0.00800 MultiLingual Genial78.par2", _ " 12 v12.0.00800 ####### MultiLingual Genial78.part1.rar", _ " 12 v12.0.00800 MultiLingual Genial78.part2.rar", _ "####### 12 v12.0.00800 MultiLingual ####### Genial78.part3.rar", _ " 12 v12.0.00800 MultiLingual Genial78.vol00+01.PAR2 #######", _ "####### 12 v12.0.00800 MultiLingual Genial78.vol01+02.PAR2", _ "####### 12 v12.0.00800 MultiLingual Genial78.vol03+04.PAR2", _ "####### 12 v12.0.00800 MultiLingual Genial78.vol07+08.PAR2", _ " 12 v12.0.00800 MultiLingual ####### Genial78.vol15+13.PAR2", _ "~~~~~~~.v.sfv", _ "~~~~~~~.v.1.40.208-TE000046324623770002.nfo", _ "~~~~~~~.v.1.40.208-TE.r00", _ "~~~~~~~.v.1.40.208-TE.r01", _ "~~~~~~~.v.1.40.208-TE.r02", _ "~~~~~~~.v.1.40.208-TE05.r03", _ "~~~~~~~.v.1.40.208-TE.r0417351757", _ "~~~~~~~.v.1.40.208-TE.r05asdfas", _ "~~~~~~~.v.1.40.208-TE.r06", _ "~~~~~~~.v.1.40.208-TE.rar41462347", _ "~~~~~~~.v.1.40.nzb", _ "~~~~~~~.v.1.40.par2", _ "~~~~~~~.v.1.40.vol00+1.PAR2", _ "~~~~~~~.v.1.40.vol01+2.PAR2", _ "~~~~~~~.v.1.40.vol03+4.PAR2", _ "~~~~~~~.v.1.40.vol07+6.PAR2"] local $aOut[1] For $i = 1 to ubound($aFileList) - 1 If $i = 1 Then $aOut[0] = $aFileList[$i] Else $length = StringLen($aFileList[$i]) $sBase = $aOut[0] & "00000000000000000000000000000000000000000000000000" $sTest = $aFileList[$i] & "00000000000000000000000000000000000000000000000000" If stringinstr($sBase , stringleft($sTest , floor($length / ceiling($length / 4)))) Then _ArrayAdd ($aOut , $aFileList[$i]) Else _ArrayDisplay($aOut) ReDim $aOut[1] $aOut[0] = $aFileList[$i] EndIf EndIf Next _ArrayDisplay($aOut) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
iamtheky Posted May 11, 2015 Share Posted May 11, 2015 (edited) removed* Edited May 11, 2015 by boththose double post ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now