Jump to content

Here's a small challenge


SaguratuS
 Share

Recommended Posts

Well, I have a slight problem - I need to turn this string into an array.

2207.0       0.07        12.2         257         239         249         473

Spacing varies between the variables, and are most unfortunately not tabs.

Here's an example

2207.0      10.07       112.2         257       51239         249         473 
      2208.0         0.07        12.2         257         239         249         473 
      2209.0         0.07        12.2          57          39         249          73

Any ideas, orr is this simply a dead end?

Edit: Spacing isn't showing up even as CODE, but there entire line is X characters long (with about 8-10 spaces inbetween each value) regardless of the numbers.

Edited by SaguratuS
Link to comment
Share on other sites

  • Developers

Something like ? :

$Var = "2207.0 0.07 12.2 257   239 249  473"
While StringInstr($var, "  ")
        $var = StringReplace($var, "  ", " ")  ;  doesn;t show but first " " has 2 spaces ... second " " has one  
Wend
$array = stringsplit($var," ")
Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Something like ? :

$Var = "2207.0 0.07 12.2 257   239 249  473"
While StringInstr($var, "  ")
        $var = StringReplace($var, "  ", " ") ;  doesn;t show but first " " has 2 spaces ... second " " has one  
Wend
$array = stringsplit($var," ")
Ah, didn't even think about using while to do the job - Thanks a ton!
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...