Come posso salvare i sottoinsiemi in cartelle separate con scriptHo creato uno script che importerà ed eccellerà file ed eseguirà un'analisi che produrrà 3 sottoinsiemi. Ogni sottoinsieme deve essere una cartella diversa, ma voglio che i sottoinsiemi abbiano lo stesso nome del file excel che è stato importato per creare il sottoinsieme. Come farei questo o almeno denominerei ogni sottoinsieme con un nome specifico e li salverei in cartelle diverse.
ScriptingfinestreRi: Come posso salvare i sottoinsiemi in cartelle separate con lo scriptEcco un esempio di un modo per farlo
// Open a file and create 2 subsets and then save all 3 files to
// different folders, keeping the files open in the JMP session,
// and with their original name, but naming each subset in their
// folders where they are saved
Names Default To Here( 1 );
// open the Big Class data table.
dt = Open( "$SAMPLE_DATA/big class.jmp" );
// Create subset one with all Males, letting JMP provide the new data table name
dt << select where( :sex == "M" );
dtA = dt << subset( selected columns( 0 ), selected rows( 1 ) );
// Create subset two with all Females, giving JMP the name of the new table
dt << select where( :sex == "F" );
dtB = dt << subset( selected columns( 0 ), selected rows( 1 ), Output Table( "All Females" ) );
// The Save() function automatically changes the name of the data table being saved
// to the name being specified in the file name specified in the Path of the Save()
// function. Therefore to keep the original table the original name, it has to be
// renamed back to the original name.
holdName = dt << get name;
dt << save( "C:/folderA/MyName.jmp" );
dt << set name( holdName );
// Repeat the save for the first subset
holdName = dtA << get name;
dtA << save( "C:/folderB/MyName.jmp" );
dtA << set name( holdName );
// Repeat for the second subset. The name of this subset has been specifically provided
// so the handling of this can be a little different
Data Table( "All Females" ) << save( "C:/folderC/MyName.jmp" );
Data Table( "MyName" ) << set name( "All Females" );
Ri: Come posso salvare i sottoinsiemi in cartelle separate con lo scriptInoltre @txnelson risposta estensiva di , potresti dare un'occhiata alla funzione ConvertFilePath .Anche se, come suggerisce il nome, può essere utilizzato per convertire i percorsi dei file (ad es. dai formati Windows a MacOS, o dai percorsi relativi a quelli completi), mi piace perché mi consente di manipolare i percorsi dei file mantenendo separati il nome del file e le informazioni sulla directory , senza doversi preoccupare della concatenazione delle stringhe.
per esempio
projectHomeFolder = FilePathDefinitions:getProjectHome();
path = convertFilePath("Master_Table.jmp",base(projectHomeFolder));Ri: Come posso salvare i sottoinsiemi in cartelle separate con lo scriptGrazie molte! Questo è stato incredibilmente utile