sshrum Posted June 27, 2007 Share Posted June 27, 2007 I'm writting a function to store/read multi-dim arrays to/from files When I save the an array the first line is the array dimensions with the seperator char inbetween like this: '20|5' or '234,12' Basically it's <number><seperator><number> When I read the file, I get the first line and evaluate it. Problem is I can't seem to get that seperator character... What do I need to do to single out the seperator (non-numeric). I tried IsString and IsNumber on each char in the string but they all return back the same result. Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot' Link to comment Share on other sites More sharing options...
Siao Posted June 27, 2007 Share Posted June 27, 2007 StringInStr + StringMid or StringSplit ? "be smart, drink your wine" Link to comment Share on other sites More sharing options...
DW1 Posted June 27, 2007 Share Posted June 27, 2007 not a solution but a workaround: make another dimension that holds the seperator character. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Siao Posted June 28, 2007 Share Posted June 28, 2007 Or in case you want to get the separator out of that string, use StringRegExpReplace($string, "[0-9]", "") "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 28, 2007 Moderators Share Posted June 28, 2007 Or in case you want to get the separator out of that string, use StringRegExpReplace($string, "[0-9]", "")I'm not sure I followed what the OP was wanting... but I understood it it to be something like:#include <array.au3> $aSeperate = StringRegExp($aString, '(\d+)\D(\d+)', 3) _ArrayDisplay($aSeperate);Should show all the numbers [0] Contains before separator [1] contains after, the separator would be any "Non" digit character 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...
DW1 Posted June 28, 2007 Share Posted June 28, 2007 ^ wow, what he said ^ AutoIt3 Online Help Link to comment Share on other sites More sharing options...
sshrum Posted June 28, 2007 Author Share Posted June 28, 2007 So far I like Siao's solution...all I want to know is what the non-numeric character is in the first line...his solution so do just that. Thanks everyone. Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot' 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