cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
%3CLINGO-SUB%20id%3D%22lingo-sub-337958%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ECome%20generare%20una%20media%20di%20riepilogo%20di%20pi%C3%B9%20file%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-337958%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHo%20pi%C3%B9%20file%20csv%20nel%20formato%20allegato%20in%20una%20cartella%20particolare%2C%20come%20faccio%20a%20generare%20un%20nuovo%20file%20che%20contiene%20il%20riepilogo%20della%20media%20di%20tutte%20le%20colonne%20A%2C%20B%2C%20C%2C%20D%20di%20ogni%20file%20csv%20nel%20formato%20seguente%3A%3C%2FP%3E%3CTABLE%20border%3D%220%22%20cellspacing%3D%220%22%20cellpadding%3D%220%22%3E%3CTBODY%3E%3CTR%3E%3CTD%3Enome%20del%20file%3C%2FTD%3E%3CTD%3EUN%3C%2FTD%3E%3CTD%3EB%3C%2FTD%3E%3CTD%3EC%3C%2FTD%3E%3CTD%3ED%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3Eavg_colA_file1%3C%2FTD%3E%3CTD%3Eavg_colB_file1%3C%2FTD%3E%3CTD%3Eavg_colC_file1%3C%2FTD%3E%3CTD%3Eavg_colC_file1%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3Eavg_colA_file2%3C%2FTD%3E%3CTD%3Eavg_colB_file2%3C%2FTD%3E%3CTD%3Eavg_colC_file2%3C%2FTD%3E%3CTD%3Eavg_colC_file2%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3ESo%20di%20generare%20la%20media%20di%20ogni%20file%20CSV%20utilizzando%20il%20riepilogo%20della%20tabella%2C%20ma%20come%20possiamo%20fare%20lo%20stesso%20per%20pi%C3%B9%20file%20CSV%20utilizzando%20un%20singolo%20script%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-337958%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EAnalytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETabella%20dati%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDOE%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EScripting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-337977%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20generare%20una%20media%20di%20riepilogo%20di%20pi%C3%B9%20file%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-337977%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EUsa%20%22Importazione%20di%20pi%C3%B9%20file%20()%22.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELa%20documentazione%20%C3%A8%20fornita%20nella%20Guida%20allo%20scripting%2C%20disponibile%20nella%20Libreria%20della%20documentazione%20di%20JMP%20nel%20menu%20a%20discesa%20Guida.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-337978%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20generare%20una%20media%20di%20riepilogo%20di%20pi%C3%B9%20file%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-337978%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EGrazie%2C%20ma%20questo%20importer%C3%A0%20solo%20pi%C3%B9%20file%20in%20una%20singola%20tabella%20di%20dati.%20Volevo%20sapere%20come%20posso%20calcolare%20la%20media%20di%20tutte%20le%20colonne%20in%20ogni%20file%20utilizzando%20un%20singolo%20script%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-337979%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20generare%20una%20media%20di%20riepilogo%20di%20pi%C3%B9%20file%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-337979%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EL'importazione%20di%20pi%C3%B9%20file%20ha%20la%20capacit%C3%A0%20di%20aggiungere%20una%20nuova%20colonna%20che%20contiene%20il%20nome%20del%20file%20da%20cui%20provengono%20i%20dati%20(Aggiungi%20colonna%20nome%20file).%20Ci%C3%B2%20significa%20che%20puoi%20facilmente%20aggiungere%20una%20clausola%20By%20()%20al%20tuo%20riepilogo%2C%20che%20fornir%C3%A0%20medie%20separate%20per%20ogni%20file%20importato.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-337982%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20generare%20una%20media%20di%20riepilogo%20di%20pi%C3%B9%20file%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-337982%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHai%20provato%20se%20la%20funzione%20Tabelle%20-%26gt%3B%20Riepilogo%20sta%20facendo%20il%20lavoro%20che%20desideri%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mlo1_0-1606584605026.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mlo1_0-1606584605026.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F28656i7664CE37324EFA79%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mlo1_0-1606584605026.png%22%20alt%3D%22mlo1_0-1606584605026.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mlo1_1-1606584677703.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mlo1_1-1606584677703.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F28657iA2339F07E02A2D23%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mlo1_1-1606584677703.png%22%20alt%3D%22mlo1_1-1606584677703.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-338077%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20generare%20una%20media%20di%20riepilogo%20di%20pi%C3%B9%20file%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-338077%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ESto%20provando%20lo%20script%20seguente%20ma%20non%20funziona%2C%20potresti%20per%20favore%20avvisarmi%20qual%20%C3%A8%20il%20problema%20qui%3F%3CBR%20%2F%3E%20dt%20%3D%20Importazione%20di%20pi%C3%B9%20file%20(%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20cartella%20(%3CBR%20%2F%3E%20%22C%3A%20%5C%20Users%20%5C%20my_files%20%5C%22%3CBR%20%2F%3E%20)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20filtro%20nome%20(%22*.%20*%3B%22)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20abilitazione%20nome%20(0)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20filtro%20dimensioni%20(%7B37111019%2C%2038896395%7D)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20formato%20abilitato%20(0)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20filtro%20data%20(%7B3689368844.046%2C%203689369157.819%7D)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20data%20abilita%20(0)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20colonna%20Aggiungi%20nome%20file%20(1)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20colonna%20Aggiungi%20dimensione%20file%20(0)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20colonna%20data%20file%20aggiunta%20(0)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20modalit%C3%A0%20di%20importazione%20(%22CSVData%22)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20set%20di%20caratteri%20(%22Migliore%20ipotesi%22)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20modalit%C3%A0%20stack%20(%22Stack%20simile%22)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20CSV%20ha%20intestazioni%20(1)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20CSV%20Consenti%20numerico%20(1)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20prima%20riga%20di%20intestazione%20CSV%20(1)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20il%20numero%20CSV%20di%20righe%20di%20intestazione%20(1)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20prima%20riga%20dati%20CSV%20(2)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20CSV%20EOF%20Comma%20(1)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20la%20scheda%20CSV%20EOF%20(0)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20spazio%20CSV%20EOF%20(0)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20spazi%20CSV%20EOF%20(0)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20CSV%20EOF%20Altro%20(%22%22)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20CSV%20EOL%20CRLF%20(1)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20CSV%20EOL%20CR%20(1)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20CSV%20EOL%20LF%20(1)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20CSV%20EOL%20Punto%20e%20virgola%20(0)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20CSV%20EOL%20Altro%20(%22%22)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20citazione%20CSV%20(%22%5C!%22%20%22)%2C%3CBR%20%2F%3E%20%26lt%3B%26lt%3B%20Imposta%20CSV%20Escape%20(%22%22)%3CBR%20%2F%3E%20)%20%26lt%3B%26lt%3B%20Importa%20dati%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%20dt%20%26lt%3B%26lt%3B%20Ottieni%20righe%20dove%20(%3A%20A%20%26lt%3B%3D%2020)%3B%3CBR%20%2F%3E%20dt%20%26lt%3B%26lt%3B%20elimina%20righe%20(sel)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%20dt%20%26lt%3B%26lt%3B%3CBR%20%2F%3E%20Sommario(%3CBR%20%2F%3E%20Gruppo%20(%3A%20Nome%20file)%2C%3CBR%20%2F%3E%20Media%20(%3A%20A)%2C%3CBR%20%2F%3E%20Freq%20(%22Nessuno%22)%2C%3CBR%20%2F%3E%20Peso%20(%22Nessuno%22)%3CBR%20%2F%3E%20)%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-338078%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20generare%20una%20media%20di%20riepilogo%20di%20pi%C3%B9%20file%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-338078%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EMFI%3CEM%3E%20sempre%3C%2FEM%3E%20restituisce%20un%20elenco%20di%20tabelle%20di%20dati%20(non%20una%20tabella%2C%20ma%20un%20%7Belenco%7D%20contenente%20una%20o%20pi%C3%B9%20tabelle).%20Avremmo%20bisogno%20di%20vedere%20alcuni%20messaggi%20dal%20registro%20per%20dare%20una%20risposta%20migliore%20-%20non%20sono%20sicuro%20della%20sintassi%20di%20eliminazione%20delle%20righe%20-%20ma%20uno%20di%20questi%3A%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Efor(i%3D1%2Ci%26lt%3B%3Dnitems(dt)%2Ci%2B%3D1%2C%0Adtx%20%3D%20dt%5Bi%5D%3B%0A%0Adtx%20%26lt%3B%26lt%3B%20Get%20Rows%20Where%20(%20dtx%3AA%20%26lt%3B%3D%2020)%3B%0Adtx%20%26lt%3B%26lt%3B%20delete%20rows(sel)%3B%0A%0Adtx%26lt%3B%26lt%3B%0ASummary(%0AGroup(%20dtx%3AFile%20Name%20)%2C%0AMean(%20dtx%3AA%20)%2C%0AFreq(%20%22None%22%20)%2C%0AWeight(%20%22None%22%20)%0A)%0A%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Eo%20se%20sai%20che%20ce%20n'%C3%A8%20solo%20uno%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edtx%20%3D%20dt%5B1%5D%3B%0Adtx%20%26lt%3B%26lt%3B%20Get%20Rows%20Where%20(%20dtx%3AA%20%26lt%3B%3D%2020)%3B%0Adtx%20%26lt%3B%26lt%3B%20delete%20rows(sel)%3B%0A%0Adtx%26lt%3B%26lt%3B%0ASummary(%0AGroup(%20dtx%3AFile%20Name%20)%2C%0AMean(%20dtx%3AA%20)%2C%0AFreq(%20%22None%22%20)%2C%0AWeight(%20%22None%22%20)%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Eutilizzando%20dtx%20per%20essere%20la%20tabella%20corrente%20dall'elenco%20in%20dt.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-338081%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERi%3A%20Come%20generare%20una%20media%20di%20riepilogo%20di%20pi%C3%B9%20file%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-338081%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F982%22%20target%3D%22_blank%22%3E%40Craige_Hales%3C%2FA%3E%20ha%20la%20risposta%20corretta%2C%20con%20un%20errore%20riportato%20dal%20codice%20originale.La%20variabile%20%22sel%22%20in%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edtx%20%26lt%3B%26lt%3B%20delete%20rows(sel)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Enon%20%C3%A8%20definito.Il%20codice%20deve%20essere%20modificato%20nei%20due%20seguenti%20per%20funzionare%20correttamente%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edtx%20%3D%20dt%5B1%5D%3B%0Asel%20%3D%20dtx%20%26lt%3B%26lt%3B%20Get%20Rows%20Where%20(%20dtx%3AA%20%26lt%3B%3D%2020)%3B%0Adtx%20%26lt%3B%26lt%3B%20delete%20rows(sel)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
jojmp
Level III

How to generate a summary average of multiple csv files?

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:

filenameABCD
 avg_colA_file1avg_colB_file1avg_colC_file1avg_colC_file1
 avg_colA_file2avg_colB_file2avg_colC_file2avg_colC_file2
     

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?

13 REPLIES 13
txnelson
Super User

Re: How to generate a summary average of multiple csv files?

Use "Multiple File Import()".

 

Documentation is provided in the Scripting Guide, available in the JMP Documentation Library under the Help pull down menu.

 

Jim
jojmp
Level III

Re: How to generate a summary average of multiple csv files?

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
txnelson
Super User

Re: How to generate a summary average of multiple csv files?

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.

Jim
jojmp
Level III

Re: How to generate a summary average of multiple csv files?

I am trying the below script but this does not run, could you please advise what is the issue here?

dt = Multiple File Import(
    <<Set Folder( "C:\Users\my_files\" ),
    <<Set Name Filter( "*.*;" ),
    <<Set Name Enable( 0 ),
    <<Set Size Filter( {37111019, 38896395} ),
    <<Set Size Enable( 0 ),
    <<Set Date Filter( {3689368844.046, 3689369157.819} ),
    <<Set Date Enable( 0 ),
    <<Set Add File Name Column( 1 ),
    <<Set Add File Size Column( 0 ),
    <<Set Add File Date Column( 0 ),
    <<Set Import Mode( "CSVData" ),
    <<Set Charset( "Best Guess" ),
    <<Set Stack Mode( "Stack Similar" ),
    <<Set CSV Has Headers( 1 ),
    <<Set CSV Allow Numeric( 1 ),
    <<Set CSV First Header Line( 1 ),
    <<Set CSV Number Of Header Lines( 1 ),
    <<Set CSV First Data Line( 2 ),
    <<Set CSV EOF Comma( 1 ),
    <<Set CSV EOF Tab( 0 ),
    <<Set CSV EOF Space( 0 ),
    <<Set CSV EOF Spaces( 0 ),
    <<Set CSV EOF Other( "" ),
    <<Set CSV EOL CRLF( 1 ),
    <<Set CSV EOL CR( 1 ),
    <<Set CSV EOL LF( 1 ),
    <<Set CSV EOL Semicolon( 0 ),
    <<Set CSV EOL Other( "" ),
    <<Set CSV Quote( "\!"" ),
    <<Set CSV Escape( "" )
) << Import Data;

dt << Get Rows Where( :A <= 20 );
dt << delete rows( sel );

dt << Summary( Group( :File Name ), Mean( :A ), Freq( "None" ), Weight( "None" ) );
Craige_Hales
Super User

Re: How to generate a summary average of multiple csv files?

MFI always 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:

for(i=1,i<=nitems(dt),i+=1,
dtx = dt[i];

dtx << Get Rows Where ( dtx:A <= 20);
dtx << delete rows(sel);

dtx<<
Summary(
Group( dtx:File Name ),
Mean( dtx:A ),
Freq( "None" ),
Weight( "None" )
)

)

or if you know there is only one

dtx = dt[1];
dtx << Get Rows Where ( dtx:A <= 20);
dtx << delete rows(sel);

dtx<<
Summary(
Group( dtx:File Name ),
Mean( dtx:A ),
Freq( "None" ),
Weight( "None" )
)

using dtx to be the current table from the list in dt.

Craige
txnelson
Super User

Re: How to generate a summary average of multiple csv files?

@Craige_Hales has the correct answer, with one error brought forward from the original code.  The variable "sel" in:

dtx << delete rows(sel);

is not defined.  The code needs to be changed to the below two work correctly

dtx = dt[1];
sel = dtx << Get Rows Where ( dtx:A <= 20);
dtx << delete rows(sel);
Jim
jojmp
Level III

Re: How to generate a summary average of multiple csv files?

Thanks a lot for all the valuable suggestions, please find below the final working script for reference:

dt= Multiple File Import(
	<<Set Folder(
		"C:\Users\my_files\"
	),
	<<Set Name Filter( "*.*;" ),
	<<Set Name Enable( 0 ),
	<<Set Size Filter( {37111019, 38896395} ),
	<<Set Size Enable( 0 ),
	<<Set Date Filter( {3689368844.046, 3689369157.819} ),
	<<Set Date Enable( 0 ),
	<<Set Add File Name Column( 1 ),
	<<Set Add File Size Column( 0 ),
	<<Set Add File Date Column( 0 ),
	<<Set Import Mode( "CSVData" ),
	<<Set Charset( "Best Guess" ),
	<<Set Stack Mode( "Stack Similar" ),
	<<Set CSV Has Headers( 1 ),
	<<Set CSV Allow Numeric( 1 ),
	<<Set CSV First Header Line( 1 ),
	<<Set CSV Number Of Header Lines( 1 ),
	<<Set CSV First Data Line( 2 ),
	<<Set CSV EOF Comma( 1 ),
	<<Set CSV EOF Tab( 0 ),
	<<Set CSV EOF Space( 0 ),
	<<Set CSV EOF Spaces( 0 ),
	<<Set CSV EOF Other( "" ),
	<<Set CSV EOL CRLF( 1 ),
	<<Set CSV EOL CR( 1 ),
	<<Set CSV EOL LF( 1 ),
	<<Set CSV EOL Semicolon( 0 ),
	<<Set CSV EOL Other( "" ),
	<<Set CSV Quote( "\!"" ),
	<<Set CSV Escape( "" )
) << Import Data;

dtx = dt[1];
sel = dtx << Get Rows Where ( dtx:A <= 20);
dtx << delete rows(sel);

dtx<<
Summary(
Group( dtx:File Name ),
Mean( dtx:A ),
Freq( "None" ),
Weight( "None" )
)
jojmp
Level III

Re: How to generate a summary average of multiple csv files?

Is there any way where we close all the imported tables and view only the summary table once the script has run?
txnelson
Super User

Re: How to generate a summary average of multiple csv files?

close( dtx, nosave );

I strongly that you take the time to read the Scripting Guide, and to familiarize yourself with the Scripting Index.  This will make your journey into JSL more efficient and enjoyable.

Jim