barryb Posted March 29, 2009 Share Posted March 29, 2009 (edited) Hi Guys, I am looking at splitting first name / surname so I can do AD lookups, now problem is the input file is not csv but a flat firstname 'space' surname, again not much of a problem BUT some users have double barrel surnames e.g. lin san san. Is there anyway for autoit to split on first space so I only have a 2 element array? Or do I split on the space then count the number of elements in the array to determine if i have a double barrel scenario? Any pointers would be appreciated. Thanks, Barry Edited March 29, 2009 by barryb Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 29, 2009 Moderators Share Posted March 29, 2009 #include <array.au3> ; used with _ArrayDisplay() Dim $s_name = "My Name Is" Dim $a_sre = StringRegExp($s_name, "(.+?)\s(.+?)", 1) _ArrayDisplay($a_sre, "Name split by 1 space") Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
barryb Posted March 29, 2009 Author Share Posted March 29, 2009 #include <array.au3> ; used with _ArrayDisplay() Dim $s_name = "My Name Is" Dim $a_sre = StringRegExp($s_name, "(.+?)\s(.+?)", 1) _ArrayDisplay($a_sre, "Name split by 1 space")Arrrrghh why didn't I think about regular expression!!! This has been bugging me since Friday lol. Thanks Smoke_N virtual pint heading your way 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