Re: what form of split turns a tab-delimited variable into an array with the first line as keys?

2010-04-10 Thread Robert Cole
Take a look at my Calendar Lines stack which can be found at Rev Online (in the menu toolbar) The buttons call a function in the stack script which use split and the extents to transpose an array. HTH, Bob Date: Fri, 9 Apr 2010 15:06:28 -0700 Josh Mellicker wrote: Thanks for everyone's help.

what form of split turns a tab-delimited variable into an array with the first line as keys?

2010-04-09 Thread Josh Mellicker
Given a variable like this, where the first line is headers: name [tab] color [tab] food Trevor [tab] green [tab] salad Sarah [tab] blue [tab] pizza Richard [tab] orange [tab] burgers David [tab] purple [tab] fruit What is the best way to turn this into an array, where the

Re: what form of split turns a tab-delimited variable into an array with the first line as keys?

2010-04-09 Thread Michael Kann
Using asterisks instead of tabs, put name*color*food Trevor*green*salad Sarah*blue*pizza into fld 1 -- Use this script: -- on mouseUp set the itemDelimiter to * put fld 1 into v put line 1 of v into headers_line delete line 1 of v

Re: what form of split turns a tab-delimited variable into an array with the first line as keys?

2010-04-09 Thread Bob Sneidar
Just had a few rounds with split and combine, and they are not what you think they are. Split takes the first value in a delimited line and that becomes the key. The rest of the items become the elements. The commands are fairly useless for much of anything. Bob On Apr 9, 2010, at 12:07 AM,

Re: what form of split turns a tab-delimited variable into an array with the first line as keys?

2010-04-09 Thread Björnke von Gierke
That the split and combines are useless is completely wrong. I use them all the time and it's a huge timesaver for manipulating x,y matrices. Of course, for the given Task, they do not work for what you want directly. You'll need to change the orientation first, for example thusly: on mouseUp

Re: what form of split turns a tab-delimited variable into an array with the first line as keys?

2010-04-09 Thread Jim Ault
On Apr 9, 2010, at 8:13 AM, Bob Sneidar wrote: Just had a few rounds with split and combine, and they are not what you think they are. Split takes the first value in a delimited line and that becomes the key. The rest of the items become the elements. The commands are fairly useless for

Re: what form of split turns a tab-delimited variable into an array with the first line as keys?

2010-04-09 Thread Josh Mellicker
Thanks for everyone's help. Though Bjoernke's solution looks clever, I could not get it to work. I ended up with this ugly thing: function turnIntoArray p put line 1 of p into tHeaders set the itemDelimiter to tab repeat with x = 2 to the number of lines in p repeat with y = 1 to

Re: what form of split turns a tab-delimited variable into an array with the first line as keys?

2010-04-09 Thread Björnke von Gierke
Oi my solution works fine, it must b your computer that's amiss :P No seriously, i tested it here and it did what I thought you wanted? On 10 Apr 2010, at 00:06, Josh Mellicker wrote: Thanks for everyone's help. Though Bjoernke's solution looks clever, I could not get it to work. I