Hest Posted August 11, 2008 Share Posted August 11, 2008 I have tried different string functions, but cant figure this one out. I have this string (exactly as written): <REPLY get(1, info)> 1 ECoS 1 ProtocolVersion[0.1] 1 ApplicationVersion[1.1.2] 1 HardwareVersion[1.4] <END 0 (OK)> <REPLY get(10, size)> 10 size[3] <END 0 (OK)> I need to put everything with a number in front into an array and still be able to count the number of arrays that has 1 or 10 or whatever number is in front (the numbers in front will change) Something like this: $array[1][0] = Ecos $array[1][1] = ProtocolVersion[0.1] $array[1][2] = ApplicationVersion[1.1.2] $array[1][3] = HardwareVersion[1.4] $array[10][0] = size[3] How exactly do I have to do that. Or is there a better way. Software:Model Train Calculator (Screen)Autoit3 beginner! Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 11, 2008 Share Posted August 11, 2008 I have tried different string functions, but cant figure this one out. I have this string (exactly as written): <REPLY get(1, info)> 1 ECoS 1 ProtocolVersion[0.1] 1 ApplicationVersion[1.1.2] 1 HardwareVersion[1.4] <END 0 (OK)> <REPLY get(10, size)> 10 size[3] <END 0 (OK)> I need to put everything with a number in front into an array and still be able to count the number of arrays that has 1 or 10 or whatever number is in front (the numbers in front will change) Something like this: $array[1][0] = Ecos $array[1][1] = ProtocolVersion[0.1] $array[1][2] = ApplicationVersion[1.1.2] $array[1][3] = HardwareVersion[1.4] $array[10][0] = size[3] How exactly do I have to do that. Or is there a better way. Get down and geeky with StringRegExp(). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Hest Posted August 11, 2008 Author Share Posted August 11, 2008 Get down and geeky with StringRegExp(). Thx but can you guide me a little more. Do I need to use stringsplit() first and then stringregexp() to check every string in the array? Software:Model Train Calculator (Screen)Autoit3 beginner! Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 11, 2008 Share Posted August 11, 2008 Thx but can you guide me a little more. Do I need to use stringsplit() first and then stringregexp() to check every string in the array?If you're not up to RegExp, then:1. Use StringInStr() to find the first SPACE in each line2. StringLeft() to get the part before the first space3. StringIsInt() will tell you if that part is an integer4. If it is an integer, process the rest of the line as required, else skip it Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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