cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
christianguhr
Level III

Multiple File Import - Name Filter Problem and/or

Hi all,

I have a folder full of measurement data already in the .jmp format. With JSL and the Multiple File Import I'm defining a search string which only should open files with that string. Here ist what that part of my script looks like:

searchstring="202112*;*322958*";

dt_raw=Multiple File Import(
	<<Set Folder( "C:\Folder\" ),
	<<Set Show Hidden( 0 ),
	<<Set Subfolders( 0 ),
	<<Set Name Filter( searchstring ),
	<<Set Name Enable( 1 )
) << Import Data;

Unfortunately, It  opens data containing the first string OR the second string instead of the first string AND the second (what I need). Is there a way to define the search string that it opens files with the first AND second string?

 

Edit: The files I'm importing look like this: 202112041419_9301_007_322958_P_11217400_11217397_11217404_11217402_raw.jmp and differ in length and position of my search string from file to file.

Best, Christian

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: Multiple File Import - Name Filter Problem and/or

I believe the search string you want to use is

searchstring="202112*322958*";
Jim

View solution in original post

Craige_Hales
Super User

Re: Multiple File Import - Name Filter Problem and/or

yes. There are two special characters that can be in the MFI name pattern, ? and * . The ? matches exactly one character and the * matches zero or more. To match a name like this

202112041419_9301_007_322958_P_11217400_11217397_11217404_11217402_raw.jmp

for 202112 followed by 322958 you might use

202112??????_*_???_322958_?_*_*_*_*_raw.jmp

if you wanted to be really really careful about what is accepted. Or, depending how variable the format is, relax it all the way down to Jim's suggestion.

Craige

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Multiple File Import - Name Filter Problem and/or

I believe the search string you want to use is

searchstring="202112*322958*";
Jim
Craige_Hales
Super User

Re: Multiple File Import - Name Filter Problem and/or

yes. There are two special characters that can be in the MFI name pattern, ? and * . The ? matches exactly one character and the * matches zero or more. To match a name like this

202112041419_9301_007_322958_P_11217400_11217397_11217404_11217402_raw.jmp

for 202112 followed by 322958 you might use

202112??????_*_???_322958_?_*_*_*_*_raw.jmp

if you wanted to be really really careful about what is accepted. Or, depending how variable the format is, relax it all the way down to Jim's suggestion.

Craige
christianguhr
Level III

Re: Multiple File Import - Name Filter Problem and/or

Thanks both of you @Craige_Hales  and @txnelson. It works perfect.

 

Merci,

Christian