gerym Posted November 29, 2012 Share Posted November 29, 2012 (edited) My work is : I have one file abc.txt , in this file there is many special names and I must collect them , then report all of them . Ex : in 1 paragraph as : London sdjksdjkfhdskfhsjkfhdsjkf Paris kldfjkldsjfdslkfjsldfkj New York sdjkfhdsjkfhdsjkfdshfksh London blah blah blah ... I must delete all but "London" , "Paris" and "New York" ... and the last it is : London Paris New York London ... so I can save it . Any ideas ? Thanks first if u can help me Edited November 29, 2012 by gerym Link to comment Share on other sites More sharing options...
PhoenixXL Posted November 29, 2012 Share Posted November 29, 2012 look at StringRegExp or StringReplace My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
gerym Posted November 29, 2012 Author Share Posted November 29, 2012 hmm ... I don't understand ... can u give me code for example ... Link to comment Share on other sites More sharing options...
JohnOne Posted November 29, 2012 Share Posted November 29, 2012 I believe it's time you posted an effort, you have not produced a single piece of your own code since arriving. Look at stringsplit for starters. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
PhoenixXL Posted November 29, 2012 Share Posted November 29, 2012 Example#include-once #include <Array.au3> $sString = "London sdjksdjkfhdskfhsjkfhdsjkf Paris kldfjkldsjfdslkfjsldfkj New York sdjkfhdsjkfhdsjkfdshfksh London blah blah blah ..." RegEx ( $sString ) MsgBox( 64, 'Replaced', $sString ) Func RegEx( ByRef $sString ) $aRet = StringRegExp ( $sString, '(London|Paris|New York)', 3 ) $sString = _ArrayToString( $aRet , ' ' ) EndFunc gerym 1 My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
Gotemp Posted November 29, 2012 Share Posted November 29, 2012 Maybe i should just start asking for code rather than learning :/ Link to comment Share on other sites More sharing options...
water Posted November 29, 2012 Share Posted November 29, 2012 No, you shouldn't Usually we don't hand feed users here. We try to teach them how to fish. 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...
Gotemp Posted November 29, 2012 Share Posted November 29, 2012 I was just messing Water as i prefer to try and write my own scripts then if i get stuck then yes i would ask with some code to gt told "wooow there is a much better way lol" but as John said all posts have been without code an i believe one thread closed for game related. Link to comment Share on other sites More sharing options...
gerym Posted November 29, 2012 Author Share Posted November 29, 2012 Thanks all . i understood what u said ... and btw , PhoenixXL , i like your avatar ... Sr for 1 more question : How can split $sString , ex $a1 = "London" , $a2 = "Paris" , $a3 = "New York" , $a4 = "London" ??? sorry for my bad :| I'm not good at english so something I understand and else i don't Link to comment Share on other sites More sharing options...
water Posted November 29, 2012 Share Posted November 29, 2012 You don't need to split $sString. $aRet is alread the array you need. 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...
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