Page 1 of 1

Multi-dimensional Split

Posted: Mon Apr 21, 2014 3:04 pm
by dunbarx
This came up in a recent thread, the possibility to use the "Split" command (and conversely, I suppose, "Combine") with multi-dimensional arrays:

put "1,1,x" & return & "1,1,y" & return &"1,1,z" & return & "1,2,a" & return & "1,2,b" & return &"1,2,c" into temp
split temp by "comma & comma & return"

Would yield an array with:

1 1 x
1 1 y
1 1 z
1 2 a
1 2 b
1 2 c

Can the string be grokked correctly, in that the parser knows to expect two delimiters (commas) in each line (the return)? This looks like it would be easy to break, if, say. the "1" in the second line above was instead a "7". A great deal of order would be necessary to have this run smoothly. Same with going the other way:

Combine temp with comma and comma and return.

Craig Newman

Re: Multi-dimensional Split

Posted: Mon Apr 21, 2014 9:30 pm
by [-hh]
..........

Re: Multi-dimensional Split

Posted: Tue Apr 22, 2014 1:19 am
by dunbarx
Hermann.

You can visualize four dimensions? I have trouble with three.

You read Abbot's "Flatland" I suppose? But did you ever read a science fiction story by Miles Breuer, called "The Captured Cross-Section"? Now that is a great way to wrestle with the fourth physical dimension. And I do mean wrestle. I have mine in a compilation called "Fantasia Mathematica" edited by Clifton Fadiman. If you already know this, fine. If not, run, do not walk, to your nearest Amazon portal. Trust me.

Craig

Re: Multi-dimensional Split

Posted: Tue Apr 22, 2014 3:01 am
by [-hh]
..........

Re: Multi-dimensional Split

Posted: Tue Apr 22, 2014 3:45 am
by dunbarx
Aw, shucks, Hermann.

But did you order "Fantasia Mathematica?

Re: Multi-dimensional Split

Posted: Tue Apr 22, 2014 11:24 am
by [-hh]
..........

Re: Multi-dimensional Split

Posted: Tue Apr 22, 2014 6:46 pm
by mwieder
Craig-

Thanks for the reference to the book. Rather than order through the dreaded amazon, I ordered a copy from Pegasus Books, my local independent bookstore. And I'm looking forward to reading the stories.