- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Selecting only csv files using jsl
Hi,
I have folder with multiple folders and csv files. I would like to open only csv files and concatenate them without opening folders
I tried using Files in Directory function and opening files from folder but this opens the folders as well
Can some one please help me on this?
I have folder with multiple folders and csv files. I would like to open only csv files and concatenate them without opening folders
I tried using Files in Directory function and opening files from folder but this opens the folders as well
Can some one please help me on this?
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Selecting only csv files using jsl
You can easily filter the list of files returned from Files in Directory, to return only .csv files
Names Default To Here( 1 );
files = Files In Directory( "C:\Program Files\JMP\JMPPRO\18\Samples\Import Data", recursive( 0 ) );
onlycsv = Filter Each( {x}, files, contains(x,".csv"));
You may also want to look into using Multiple File Import. If your .csv files are similar MFI can automatically concatenate them for you
Names Default To Here( 1 );
mfi = Multiple File Import();
mfi << Set Folder( "$SAMPLE_IMPORT_DATA" );
mfi << Set Name Filter( "*.csv" );
mfi << Set Name Enable( 1 );
mfi << Set Stack Mode( "Stack Similar" );
mfi << Set Subfolders( 0 );
tables = mfi << Import Data();
Jim
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Selecting only csv files using jsl
You can easily filter the list of files returned from Files in Directory, to return only .csv files
Names Default To Here( 1 );
files = Files In Directory( "C:\Program Files\JMP\JMPPRO\18\Samples\Import Data", recursive( 0 ) );
onlycsv = Filter Each( {x}, files, contains(x,".csv"));
You may also want to look into using Multiple File Import. If your .csv files are similar MFI can automatically concatenate them for you
Names Default To Here( 1 );
mfi = Multiple File Import();
mfi << Set Folder( "$SAMPLE_IMPORT_DATA" );
mfi << Set Name Filter( "*.csv" );
mfi << Set Name Enable( 1 );
mfi << Set Stack Mode( "Stack Similar" );
mfi << Set Subfolders( 0 );
tables = mfi << Import Data();
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Selecting only csv files using jsl
Thank you so much.
It worked.