Jump to content

Recommended Posts

Posted

I'm currently reading in lines from a file using the _FileReadToArray function.

The lines contain rows of scientific notation numbers, some negative and some positive. If I use StringSplit with a space as the delimiter I can create an array of the numbers however due to the format of the file, where one or more spaces seperate the numbers, this array also contains some blank entries. I am trying to check each array entry to see if it is a number. Do any of the built in functions handle scientific notation ? I can not seem to get it to work using isNumber or StringIsNum.

DiZ

Posted

Check out StringStripWS(). There's an option to strip multiple spaces down to a single space. That would ensure no blank elements in the array.

Posted

Check out StringStripWS().  There's an option to strip multiple spaces down to a single space.  That would ensure no blank elements in the array.

<{POST_SNAPBACK}>

Thanks for the advice,

DiZ

Posted

Replace any instances of two-consecutive spaces with a single space?

StringReplace($line, "  ", " ")

<{POST_SNAPBACK}>

Thanks also,

DiZ

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...