water Posted January 21, 2012 Share Posted January 21, 2012 Yes, I think that is what he wants. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Read Posted January 21, 2012 Author Share Posted January 21, 2012 kylomas,Yes and one other number.$sNd1 = "01 02 14 32 37"01 02 07 14 32 37and 07 is other number and delete this line 01 02 07 14 32 37That's all.GRR, my Eng. Link to comment Share on other sites More sharing options...
kylomas Posted January 21, 2012 Share Posted January 21, 2012 @water - got any ideas that don't bury the processor? kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
UEZ Posted January 21, 2012 Share Posted January 21, 2012 (edited) I updated the code from Please try again.RegEx only split lines with @LF and last line has no @LF!Btw, you must enter the exact line with the combination otherwise search for that particular element will fail.Br,UEZ Edited January 21, 2012 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
kylomas Posted January 21, 2012 Share Posted January 21, 2012 @water, et al, Is it possible in regex to find all lines that contain a set ( in this case numbers)? kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
water Posted January 21, 2012 Share Posted January 21, 2012 @ReadIs it always the third block of numbers that is "unknown" like in "01 02 07 14 32 37" or is possible to be at any other position like in "01 02 14 17 32 37"? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Read Posted January 21, 2012 Author Share Posted January 21, 2012 @WaterYes. This is right: or is possible to be at any other position like in "01 02 14 17 32 37"? Link to comment Share on other sites More sharing options...
kylomas Posted January 21, 2012 Share Posted January 21, 2012 @water, That is why I asked about regex. Finding a "set" with regex has to be better than testing each number on each line against all positions in a search argument (my processor is sore just thinking about it). kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Read Posted January 21, 2012 Author Share Posted January 21, 2012 UEZ $sNd1 = "01 02 07 14 32 37" Here is 6 numbers and work but I need 5 numbers. I tried (5) and not working Link to comment Share on other sites More sharing options...
kylomas Posted January 21, 2012 Share Posted January 21, 2012 Read, We are shooting at a moving target. Will it always be 5 numbers and can the missing number be in any position? kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
UEZ Posted January 21, 2012 Share Posted January 21, 2012 In your 1st post you have 7 lines of combinations. Removing 2 lines means 5 lines left. Btw, I updated the code again which should also work for multible double lines. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
water Posted January 21, 2012 Share Posted January 21, 2012 If we search for "01 02 14 32 37" it should find "01 02 07 14 32 37" and "01 02 14 17 32 37" and delete this records. I'm just trying to find the correct regexp for that. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
kylomas Posted January 21, 2012 Share Posted January 21, 2012 @UEZ, The 5 does NOT mean lines. It means number of numbers in the search argument. @Read - Is this right? I think I have a regex that will work but the search argument numbers have to appears in the same order as the line they might be found in. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
kylomas Posted January 21, 2012 Share Posted January 21, 2012 @water, A regex that will work is ".*nn.*nn.*nn.*" where nn = each number to search for, but they have to be in the order that they might be found (example of 3 number search argument) kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Read Posted January 21, 2012 Author Share Posted January 21, 2012 Yes, exactly!!!!!If we search for "01 02 14 32 37" it should find "01 02 07 14 32 37" and "01 02 14 17 32 37" and delete this records. I'm just trying to find the correct regexp for that. Link to comment Share on other sites More sharing options...
iamtheky Posted January 21, 2012 Share Posted January 21, 2012 (edited) if its only a max of 5 strings seems easier to handle them independently. Probably slower, but seems effective. #Include <File.au3> #Include <Array.au3> Global $Farray $sNd1 = "01" $sNd2 = "02" $sNd3 = "14" $sNd4 = "37" $tNd1 = "01" $tNd2 = "03" $tNd3 = "06" $tNd4 = "07" $tNd5 = "43" filecopy ("combo.txt" , "combobackup.txt") _FileReadToArray ("combo.txt" , $Farray) _ArrayDelete ($Farray , 0) for $i = ubound ($Farray) -1 to 0 step -1 if stringinstr($Farray[$i], $sNd1) And stringinstr($Farray[$i] , $sNd2) And stringinstr($Farray[$i] , $sNd3) And stringinstr($Farray[$i] , $sNd4) Then _ArrayDelete ($Farray , $i) elseif stringinstr($Farray[$i], $tNd1) And stringinstr($Farray[$i] , $tNd2) And stringinstr($Farray[$i] , $tNd3) And stringinstr($Farray[$i] , $tNd4) And stringinstr($Farray[$i] , $tNd5)Then _ArrayDelete ($Farray , $i) Endif Next _FileWriteFromArray ("combo.txt" , $Farray) Edited January 21, 2012 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
water Posted January 21, 2012 Share Posted January 21, 2012 (edited) This works for the cases I described in my last post.$iResult = StringRegExp($sString2, '(01).+(02).+(14).+(32).+(37)')Edit: Too late @kylomasYour solution works for 5 groups of numbers as well. Edited January 21, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Read Posted January 21, 2012 Author Share Posted January 21, 2012 @boththose This work but terrible to manage. Array sounds good where I can paste our combinations - 100+. Like PHP code: $find= array(array(01, 02, 14, 37), array(01, 03, 06, 07, 43)); Big Thanks Link to comment Share on other sites More sharing options...
Read Posted January 21, 2012 Author Share Posted January 21, 2012 @boththose Big File say Big Error "Error allocating memory" Link to comment Share on other sites More sharing options...
kylomas Posted January 21, 2012 Share Posted January 21, 2012 Read, You should store all delete entries in a file. Your application should read the file and construct regex replace stmts based on matches as water and I have been discussing. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill 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