<?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 generate a summary average of multiple csv files? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338090#M58592</link>
    <description>Sure but I could not find my answer there because close( dtx, nosave ); closes both the data table and summary table. I wanted to close only the data table &amp;amp; keep the summary table open, is that possible?</description>
    <pubDate>Sun, 29 Nov 2020 17:52:51 GMT</pubDate>
    <dc:creator>jojmp</dc:creator>
    <dc:date>2020-11-29T17:52:51Z</dc:date>
    <item>
      <title>How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/337958#M58563</link>
      <description>&lt;P&gt;I have multiple csv files in the attached format in a particular folder , how do I generate a new file which contains the summary of the average of all the columns A, B, C, D of each csv file in the below format:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;filename&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;avg_colA_file1&lt;/TD&gt;&lt;TD&gt;avg_colB_file1&lt;/TD&gt;&lt;TD&gt;avg_colC_file1&lt;/TD&gt;&lt;TD&gt;avg_colC_file1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;avg_colA_file2&lt;/TD&gt;&lt;TD&gt;avg_colB_file2&lt;/TD&gt;&lt;TD&gt;avg_colC_file2&lt;/TD&gt;&lt;TD&gt;avg_colC_file2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I know to generate the average of each csv file using table summary but how can we do the same for multiple csv files using a single script?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:22:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/337958#M58563</guid>
      <dc:creator>jojmp</dc:creator>
      <dc:date>2023-06-10T23:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/337977#M58564</link>
      <description>&lt;P&gt;Use "Multiple File Import()".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Documentation is provided in the Scripting Guide, available in the JMP Documentation Library under the Help pull down menu.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 15:31:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/337977#M58564</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-11-28T15:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/337978#M58565</link>
      <description>Thanks but this will only import multiple files into a single data table. I wanted to know how can I calculate the average of all columns in each file using a single script</description>
      <pubDate>Sat, 28 Nov 2020 16:04:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/337978#M58565</guid>
      <dc:creator>jojmp</dc:creator>
      <dc:date>2020-11-28T16:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/337979#M58566</link>
      <description>&lt;P&gt;The Multiple File Import has the ability to add a new column which contains the file name of file the data came from(Add File Name Column). This means that you can easily add a By() clause to your summary, which will provide separate averages for each file imported.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 17:31:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/337979#M58566</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-11-28T17:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/337982#M58567</link>
      <description>&lt;P&gt;Did you try if Tables -&amp;gt; Summary function is doing the job you want?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mlo1_0-1606584605026.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28656i7664CE37324EFA79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mlo1_0-1606584605026.png" alt="mlo1_0-1606584605026.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mlo1_1-1606584677703.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28657iA2339F07E02A2D23/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mlo1_1-1606584677703.png" alt="mlo1_1-1606584677703.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 17:33:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/337982#M58567</guid>
      <dc:creator>mlo1</dc:creator>
      <dc:date>2020-11-28T17:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338077#M58581</link>
      <description>&lt;P&gt;I am trying the below script but this does not run, could you please advise what is the issue here?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Multiple File Import(
    &amp;lt;&amp;lt;Set Folder( "C:\Users\my_files\" ),
    &amp;lt;&amp;lt;Set Name Filter( "*.*;" ),
    &amp;lt;&amp;lt;Set Name Enable( 0 ),
    &amp;lt;&amp;lt;Set Size Filter( {37111019, 38896395} ),
    &amp;lt;&amp;lt;Set Size Enable( 0 ),
    &amp;lt;&amp;lt;Set Date Filter( {3689368844.046, 3689369157.819} ),
    &amp;lt;&amp;lt;Set Date Enable( 0 ),
    &amp;lt;&amp;lt;Set Add File Name Column( 1 ),
    &amp;lt;&amp;lt;Set Add File Size Column( 0 ),
    &amp;lt;&amp;lt;Set Add File Date Column( 0 ),
    &amp;lt;&amp;lt;Set Import Mode( "CSVData" ),
    &amp;lt;&amp;lt;Set Charset( "Best Guess" ),
    &amp;lt;&amp;lt;Set Stack Mode( "Stack Similar" ),
    &amp;lt;&amp;lt;Set CSV Has Headers( 1 ),
    &amp;lt;&amp;lt;Set CSV Allow Numeric( 1 ),
    &amp;lt;&amp;lt;Set CSV First Header Line( 1 ),
    &amp;lt;&amp;lt;Set CSV Number Of Header Lines( 1 ),
    &amp;lt;&amp;lt;Set CSV First Data Line( 2 ),
    &amp;lt;&amp;lt;Set CSV EOF Comma( 1 ),
    &amp;lt;&amp;lt;Set CSV EOF Tab( 0 ),
    &amp;lt;&amp;lt;Set CSV EOF Space( 0 ),
    &amp;lt;&amp;lt;Set CSV EOF Spaces( 0 ),
    &amp;lt;&amp;lt;Set CSV EOF Other( "" ),
    &amp;lt;&amp;lt;Set CSV EOL CRLF( 1 ),
    &amp;lt;&amp;lt;Set CSV EOL CR( 1 ),
    &amp;lt;&amp;lt;Set CSV EOL LF( 1 ),
    &amp;lt;&amp;lt;Set CSV EOL Semicolon( 0 ),
    &amp;lt;&amp;lt;Set CSV EOL Other( "" ),
    &amp;lt;&amp;lt;Set CSV Quote( "\!"" ),
    &amp;lt;&amp;lt;Set CSV Escape( "" )
) &amp;lt;&amp;lt; Import Data;

dt &amp;lt;&amp;lt; Get Rows Where( :A &amp;lt;= 20 );
dt &amp;lt;&amp;lt; delete rows( sel );

dt &amp;lt;&amp;lt; Summary( Group( :File Name ), Mean( :A ), Freq( "None" ), Weight( "None" ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Nov 2020 14:22:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338077#M58581</guid>
      <dc:creator>jojmp</dc:creator>
      <dc:date>2020-11-30T14:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338078#M58582</link>
      <description>&lt;P&gt;MFI &lt;EM&gt;always&lt;/EM&gt; returns a list of data tables (not one table, but a { list } holding one or more tables). We'd need to see some messages from the log to give a better answer--not sure about the delete rows syntax--but either of these:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for(i=1,i&amp;lt;=nitems(dt),i+=1,
dtx = dt[i];

dtx &amp;lt;&amp;lt; Get Rows Where ( dtx:A &amp;lt;= 20);
dtx &amp;lt;&amp;lt; delete rows(sel);

dtx&amp;lt;&amp;lt;
Summary(
Group( dtx:File Name ),
Mean( dtx:A ),
Freq( "None" ),
Weight( "None" )
)

)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or if you know there is only one&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtx = dt[1];
dtx &amp;lt;&amp;lt; Get Rows Where ( dtx:A &amp;lt;= 20);
dtx &amp;lt;&amp;lt; delete rows(sel);

dtx&amp;lt;&amp;lt;
Summary(
Group( dtx:File Name ),
Mean( dtx:A ),
Freq( "None" ),
Weight( "None" )
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;using dtx to be the current table from the list in dt.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2020 09:55:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338078#M58582</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-11-29T09:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338081#M58583</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;has the correct answer, with one error brought forward from the original code.&amp;nbsp; The variable "sel" in:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtx &amp;lt;&amp;lt; delete rows(sel);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is not defined.&amp;nbsp; The code needs to be changed to the below two work correctly&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtx = dt[1];
sel = dtx &amp;lt;&amp;lt; Get Rows Where ( dtx:A &amp;lt;= 20);
dtx &amp;lt;&amp;lt; delete rows(sel);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Nov 2020 10:20:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338081#M58583</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-11-29T10:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338087#M58589</link>
      <description>&lt;P&gt;Thanks a lot for all the valuable suggestions, please find below the final working script for reference:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt= Multiple File Import(
	&amp;lt;&amp;lt;Set Folder(
		"C:\Users\my_files\"
	),
	&amp;lt;&amp;lt;Set Name Filter( "*.*;" ),
	&amp;lt;&amp;lt;Set Name Enable( 0 ),
	&amp;lt;&amp;lt;Set Size Filter( {37111019, 38896395} ),
	&amp;lt;&amp;lt;Set Size Enable( 0 ),
	&amp;lt;&amp;lt;Set Date Filter( {3689368844.046, 3689369157.819} ),
	&amp;lt;&amp;lt;Set Date Enable( 0 ),
	&amp;lt;&amp;lt;Set Add File Name Column( 1 ),
	&amp;lt;&amp;lt;Set Add File Size Column( 0 ),
	&amp;lt;&amp;lt;Set Add File Date Column( 0 ),
	&amp;lt;&amp;lt;Set Import Mode( "CSVData" ),
	&amp;lt;&amp;lt;Set Charset( "Best Guess" ),
	&amp;lt;&amp;lt;Set Stack Mode( "Stack Similar" ),
	&amp;lt;&amp;lt;Set CSV Has Headers( 1 ),
	&amp;lt;&amp;lt;Set CSV Allow Numeric( 1 ),
	&amp;lt;&amp;lt;Set CSV First Header Line( 1 ),
	&amp;lt;&amp;lt;Set CSV Number Of Header Lines( 1 ),
	&amp;lt;&amp;lt;Set CSV First Data Line( 2 ),
	&amp;lt;&amp;lt;Set CSV EOF Comma( 1 ),
	&amp;lt;&amp;lt;Set CSV EOF Tab( 0 ),
	&amp;lt;&amp;lt;Set CSV EOF Space( 0 ),
	&amp;lt;&amp;lt;Set CSV EOF Spaces( 0 ),
	&amp;lt;&amp;lt;Set CSV EOF Other( "" ),
	&amp;lt;&amp;lt;Set CSV EOL CRLF( 1 ),
	&amp;lt;&amp;lt;Set CSV EOL CR( 1 ),
	&amp;lt;&amp;lt;Set CSV EOL LF( 1 ),
	&amp;lt;&amp;lt;Set CSV EOL Semicolon( 0 ),
	&amp;lt;&amp;lt;Set CSV EOL Other( "" ),
	&amp;lt;&amp;lt;Set CSV Quote( "\!"" ),
	&amp;lt;&amp;lt;Set CSV Escape( "" )
) &amp;lt;&amp;lt; Import Data;

dtx = dt[1];
sel = dtx &amp;lt;&amp;lt; Get Rows Where ( dtx:A &amp;lt;= 20);
dtx &amp;lt;&amp;lt; delete rows(sel);

dtx&amp;lt;&amp;lt;
Summary(
Group( dtx:File Name ),
Mean( dtx:A ),
Freq( "None" ),
Weight( "None" )
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Nov 2020 16:27:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338087#M58589</guid>
      <dc:creator>jojmp</dc:creator>
      <dc:date>2020-11-29T16:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338088#M58590</link>
      <description>Is there any way where we close all the imported tables and view only the summary table once the script has run?</description>
      <pubDate>Sun, 29 Nov 2020 17:07:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338088#M58590</guid>
      <dc:creator>jojmp</dc:creator>
      <dc:date>2020-11-29T17:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338089#M58591</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;close( dtx, nosave );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I strongly that you take the time to read the Scripting Guide, and to familiarize yourself with the Scripting Index.&amp;nbsp; This will make your journey into JSL more efficient and enjoyable.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2020 17:20:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338089#M58591</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-11-29T17:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338090#M58592</link>
      <description>Sure but I could not find my answer there because close( dtx, nosave ); closes both the data table and summary table. I wanted to close only the data table &amp;amp; keep the summary table open, is that possible?</description>
      <pubDate>Sun, 29 Nov 2020 17:52:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338090#M58592</guid>
      <dc:creator>jojmp</dc:creator>
      <dc:date>2020-11-29T17:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338091#M58593</link>
      <description>The reason for it closing the summary table is that you specified to Link the summary table to the original table.  Change or add &lt;BR /&gt;     Link to Original Data Table(0)</description>
      <pubDate>Sun, 29 Nov 2020 18:04:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338091#M58593</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-11-29T18:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a summary average of multiple csv files?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338093#M58595</link>
      <description>Thanks a lot really appreciate your inputs!</description>
      <pubDate>Sun, 29 Nov 2020 19:00:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-a-summary-average-of-multiple-csv-files/m-p/338093#M58595</guid>
      <dc:creator>jojmp</dc:creator>
      <dc:date>2020-11-29T19:00:09Z</dc:date>
    </item>
  </channel>
</rss>

