<?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 Re: How to provide column names manually in script for importing multiple text files? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-provide-column-names-manually-in-script-for-importing/m-p/725425#M90994</link>
    <description>&lt;P&gt;You could for example have a list of column names and then loop over that list while setting the names. Depending where you get the names how you might want to loop might be different&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(0),
	Compress File When Saved(1),
	New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([])),
	New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([])),
	New Column("Column 3", Numeric, "Continuous", Format("Best", 12), Set Values([])),
	New Column("Column 4", Numeric, "Continuous", Format("Best", 12), Set Values([]))
);

mycols = {"a", "b", "c", "d"};
wait(1); // for demo purposes

For Each({colname, idx}, dt &amp;lt;&amp;lt; Get Column Names("String"),
	Column(dt, colname) &amp;lt;&amp;lt; Set Name(mycols[idx]);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might also be already add the names in the import script but it might depend on your file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2024 17:27:29 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-02-26T17:27:29Z</dc:date>
    <item>
      <title>How to provide column names manually in script for importing multiple text files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-provide-column-names-manually-in-script-for-importing/m-p/725409#M90991</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to use the import multiple files tool to get a Skelton script. I would like to add column names to created table through the script. Is there a way to do that?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Singhthisside_0-1708963754608.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/61480iBC85CEF264B75351/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Singhthisside_0-1708963754608.png" alt="Singhthisside_0-1708963754608.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 16:10:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-provide-column-names-manually-in-script-for-importing/m-p/725409#M90991</guid>
      <dc:creator>Singhthisside</dc:creator>
      <dc:date>2024-02-26T16:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to provide column names manually in script for importing multiple text files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-provide-column-names-manually-in-script-for-importing/m-p/725425#M90994</link>
      <description>&lt;P&gt;You could for example have a list of column names and then loop over that list while setting the names. Depending where you get the names how you might want to loop might be different&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(0),
	Compress File When Saved(1),
	New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([])),
	New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([])),
	New Column("Column 3", Numeric, "Continuous", Format("Best", 12), Set Values([])),
	New Column("Column 4", Numeric, "Continuous", Format("Best", 12), Set Values([]))
);

mycols = {"a", "b", "c", "d"};
wait(1); // for demo purposes

For Each({colname, idx}, dt &amp;lt;&amp;lt; Get Column Names("String"),
	Column(dt, colname) &amp;lt;&amp;lt; Set Name(mycols[idx]);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might also be already add the names in the import script but it might depend on your file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 17:27:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-provide-column-names-manually-in-script-for-importing/m-p/725425#M90994</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-02-26T17:27:29Z</dc:date>
    </item>
  </channel>
</rss>

