Multi-dimensional Split
Moderator: Klaus
Multi-dimensional Split
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
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
..........
Last edited by [-hh] on Wed Aug 13, 2014 1:07 pm, edited 1 time in total.
shiftLock happens
Re: Multi-dimensional Split
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
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
..........
Last edited by [-hh] on Wed Aug 13, 2014 1:07 pm, edited 1 time in total.
shiftLock happens
Re: Multi-dimensional Split
Aw, shucks, Hermann.
But did you order "Fantasia Mathematica?
But did you order "Fantasia Mathematica?
Re: Multi-dimensional Split
..........
Last edited by [-hh] on Wed Aug 13, 2014 1:07 pm, edited 1 time in total.
shiftLock happens
Re: Multi-dimensional Split
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.
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.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev