<?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: jmp script to export data sheets to Excel with sheet names longer than 31 characters in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/474900#M71959</link>
    <description>&lt;P&gt;You can use Substr to get a part of string and dt_ref &amp;lt;&amp;lt; get name to get name of datatable. Below is example which should get you started (requires JMP16 due to Transform Each being used):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;BR /&gt;Names Default To Here(1);
dt1 = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Abrasion.jmp");

dt1 &amp;lt;&amp;lt; Set Name("veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongname");
dt2 &amp;lt;&amp;lt; Set Name("notsolongname");

dt_list = {dt1, dt2};
dt_names = Transform Each({dt_ref}, dt_list, Substr(dt_ref &amp;lt;&amp;lt; get name, 1, 31));
Show(dt_names);

Create Excel Workbook("$TEMP/MyWorkbook.xlsx", dt_list, dt_names);
Close(dt1, no save);
Close(dt2, no save);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 31 Mar 2022 13:47:11 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-03-31T13:47:11Z</dc:date>
    <item>
      <title>jmp script to export data sheets to Excel with sheet names longer than 31 characters</title>
      <link>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/474864#M71957</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to export some JMP data tables to Excel (one Excel file with separate tabs for each sheet). However, some of the data sheet names are longer than 31 characters which Excel does not support as tab names. If I try to use the 'Export' option in JMP it works nicely with names longer than 31 characters truncated. But if I try to use 'Create Excel Workbook ()' in a JMP script the software crashes.&lt;/P&gt;&lt;P&gt;Would anyone be able to help me with the script to use to export to Excel while truncating sheet names that are longer than Excel allowed 31 characters please?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:46:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/474864#M71957</guid>
      <dc:creator>DD1</dc:creator>
      <dc:date>2023-06-10T23:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: jmp script to export data sheets to Excel with sheet names longer than 31 characters</title>
      <link>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/474900#M71959</link>
      <description>&lt;P&gt;You can use Substr to get a part of string and dt_ref &amp;lt;&amp;lt; get name to get name of datatable. Below is example which should get you started (requires JMP16 due to Transform Each being used):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;BR /&gt;Names Default To Here(1);
dt1 = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Abrasion.jmp");

dt1 &amp;lt;&amp;lt; Set Name("veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongname");
dt2 &amp;lt;&amp;lt; Set Name("notsolongname");

dt_list = {dt1, dt2};
dt_names = Transform Each({dt_ref}, dt_list, Substr(dt_ref &amp;lt;&amp;lt; get name, 1, 31));
Show(dt_names);

Create Excel Workbook("$TEMP/MyWorkbook.xlsx", dt_list, dt_names);
Close(dt1, no save);
Close(dt2, no save);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Mar 2022 13:47:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/474900#M71959</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-03-31T13:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: jmp script to export data sheets to Excel with sheet names longer than 31 characters</title>
      <link>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/474967#M71960</link>
      <description>&lt;P&gt;Hi DD1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, thank you tdhi for the script.&amp;nbsp; If you don't mind sharing, please submit the script that crashes to JMP Tech Support at &lt;A href="mailto:support@jmp.com" target="_blank"&gt;support@jmp.com&lt;/A&gt;&amp;nbsp;and we'll try to fix the crash behavior for a future release.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brian Corcoran&lt;/P&gt;
&lt;P&gt;JMP Development&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 15:01:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/474967#M71960</guid>
      <dc:creator>briancorcoran</dc:creator>
      <dc:date>2022-03-31T15:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: jmp script to export data sheets to Excel with sheet names longer than 31 characters</title>
      <link>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/474968#M71961</link>
      <description>&lt;P&gt;Sorry, jthi wrote the script.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 15:02:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/474968#M71961</guid>
      <dc:creator>briancorcoran</dc:creator>
      <dc:date>2022-03-31T15:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: jmp script to export data sheets to Excel with sheet names longer than 31 characters</title>
      <link>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/475239#M71984</link>
      <description>&lt;P&gt;Many thanks jthi. However, I have JMP 15 and looks like the script cannot run the Transform command. Would you know of an alternative script please?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 15:51:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/475239#M71984</guid>
      <dc:creator>DD1</dc:creator>
      <dc:date>2022-04-01T15:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: jmp script to export data sheets to Excel with sheet names longer than 31 characters</title>
      <link>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/475247#M71986</link>
      <description>&lt;P&gt;To add to my question, say I have about 100 individual jmp files to export at once. I would not be able to define the names of each and every file seperately on the script. So what I want the script to do is export whatever the jmp files that are open at that moment including the ones with a very long name.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 16:08:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/475247#M71986</guid>
      <dc:creator>DD1</dc:creator>
      <dc:date>2022-04-01T16:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: jmp script to export data sheets to Excel with sheet names longer than 31 characters</title>
      <link>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/483265#M72763</link>
      <description>&lt;P&gt;TransformEach can be replaced with a for loop, something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// dt_names = Transform Each({dt_ref}, dt_list, Substr(dt_ref &amp;lt;&amp;lt; get name, 1, 31));
// for every dt_ref in dt_list, make a new list using substr...
dt_names = {};
for( i = 1, i &amp;lt;=nitems(dt_list), i += 1,
    dt_ref = dt_list[i];
    insert into( dt_names, substr( dt_ref &amp;lt;&amp;lt; get name, 1, 31 ) );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Apr 2022 22:25:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/jmp-script-to-export-data-sheets-to-Excel-with-sheet-names/m-p/483265#M72763</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-04-30T22:25:34Z</dc:date>
    </item>
  </channel>
</rss>

