<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Convert a list of strings into a column names in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Convert-a-list-of-strings-into-a-column-names/m-p/59290#M32552</link>
    <description>&lt;P&gt;I am trying a to run a script that uses a regex to find column names and puts them in a list to then stack. I am struggling to get the actual stack part to work and I think it has to do with the list containing strings rather then column names. Is there a way to convert a list strings into column names?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ref = open(dir||datafile);

allColNames = ref &amp;lt;&amp;lt; getcolumnnames;
edgeCols = {};

Ncols = N items(allColNames);
for(i = 1, i &amp;lt;= Ncols, i++,
	cname = Column(allColNames[i]) &amp;lt;&amp;lt; get Name;
	if(!Is Missing (regex(cname,"EDGE\d+") ),
		insert into(edgeCols,cname);
	);
);


edge stack = ref &amp;lt;&amp;lt; stack(
	columns(EdgeCols),
	Source Label Column("Label");
	Source Data Column("Data");
	Output Table("Stack");
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 04 Jun 2018 23:42:08 GMT</pubDate>
    <dc:creator>tarkan_bih</dc:creator>
    <dc:date>2018-06-04T23:42:08Z</dc:date>
    <item>
      <title>Convert a list of strings into a column names</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-a-list-of-strings-into-a-column-names/m-p/59290#M32552</link>
      <description>&lt;P&gt;I am trying a to run a script that uses a regex to find column names and puts them in a list to then stack. I am struggling to get the actual stack part to work and I think it has to do with the list containing strings rather then column names. Is there a way to convert a list strings into column names?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ref = open(dir||datafile);

allColNames = ref &amp;lt;&amp;lt; getcolumnnames;
edgeCols = {};

Ncols = N items(allColNames);
for(i = 1, i &amp;lt;= Ncols, i++,
	cname = Column(allColNames[i]) &amp;lt;&amp;lt; get Name;
	if(!Is Missing (regex(cname,"EDGE\d+") ),
		insert into(edgeCols,cname);
	);
);


edge stack = ref &amp;lt;&amp;lt; stack(
	columns(EdgeCols),
	Source Label Column("Label");
	Source Data Column("Data");
	Output Table("Stack");
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Jun 2018 23:42:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-a-list-of-strings-into-a-column-names/m-p/59290#M32552</guid>
      <dc:creator>tarkan_bih</dc:creator>
      <dc:date>2018-06-04T23:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a list of strings into a column names</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-a-list-of-strings-into-a-column-names/m-p/59328#M32562</link>
      <description>&lt;P&gt;Your syntax for stack is incorrect:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;there are semicolons where there should be commas&lt;/LI&gt;&lt;LI&gt;it is not Source Data Column but Stacked Data Column&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;edge stack = ref &amp;lt;&amp;lt; stack(
	columns( edgeCols),
	Source Label Column("Label"),
	Stacked Data Column("Data"),
	Output Table("Stack")
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jun 2018 07:49:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-a-list-of-strings-into-a-column-names/m-p/59328#M32562</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-06-05T07:49:51Z</dc:date>
    </item>
  </channel>
</rss>

