How can open multiple tables, merge them in memory, and figure out the results of the subtotals?For example, there are five data files in the "c:\1\" path that look like "Big Class.jmp" structures.
How to classify and summarize the data of "height" column by "age" column for 5 files in memory without "Concatenate".
Achieve the effect as if implemented in the following code:
dir = "c:\1\";
Fs = Files In Directory( dir );
For( d = 1, d <= 5, d++,
d1 = Open( dir || fs[d] );
If( d == 1,
d2 = d1,
d2 << Concatenate( Data Table( d1 ), Append to first table );
Close( d1, nosave );
);
);
d1 = d2<< Summary(
Group( :age ),
Sum( :height ),
Freq( "None" ),
Weight( "None" ),
Link to original data table( 0 )
);
ScriptingRe: How can open multiple tables, merge them in memory, and figure out the results of the subtotals?Here is an in memory version of your code. It does not create any visual objects, or take up any memory for visual component, and it creates 2 memory items, 1 list, and 1 matrix with the results.
names default to here(1);
dt = open("$SAMPLE_DATA/big class.jmp",private);
dt << set name("zippy");
dt2 = open("$SAMPLE_DATA/big class.jmp",private);
dt3 = dt2<< Concatenate( dt,private );
close(dt,nosave);
close(dt2,nosave);
summarize( dt3, bygroup = by(:age), heightSum = sum(:height));
close(dt3,nosave);
show(bygroup,heightSum);Re: How can open multiple tables, merge them in memory, and figure out the results of the subtotals?Thank Jim!
If there are 100 such files, set the file name to "001.JMP-100.JMP".
Splicing, sorting and summarizing 60 files at a time according to the order of file names, and output the results.So there are 41 outcomes.
The first Concatenate is to get the first result from the 001.Jmp-060.JMP file according to the above method.
For the second processing of the "002.Jmp-061.JMP" file, how to join and summarize it faster this time?
Re: How can open multiple tables, merge them in memory, and figure out the results of the subtotals?- Concatenate the first 60
- Make sure the "Create source column" option is specified
- Generate the statistics
- Read in and concatenate the new file to the 1-60 table
- Using the "Source Column" select all of the rows from data table 1
- Generate the statistics
- Repeat steps 3-5 until all 100 files are read in and analyzed