AnsweredAssumed Answered

Script insert file to match on only part of a filename

Question asked by wbultitude on Mar 29, 2017
Latest reply on Mar 31, 2017 by user19752

I'm trying to insert .BMP files into a container field ("FA_electropheragram_trace") within a table called "Amplifications", matching to a text field ("QC01_Plate_ID") and a calculated field ("FA_name_exportable") using a set variable script based loosely on import images into container field in database table . The QC01_Plate_ID directs to a subfolder within the Desktop folder, and the FA_name_exportable is a unique ID that is found within the filename of the .BMP file. However, the filename also contains preceding text that I want to be ignored. An example filename is: 2017 03 21 17H 21M A1  P03311_014_KIR2DL2_2DL3_Amp Plate 1_A01.BMP, where P03311_014_KIR2DL2_2DL3_Amp Plate 1_A01 is the FA_name_exportable and the 2017 03 21 17H 21M A1  is what I wish to be ignored.


So far I have the following, but I am unable to use "*" as a wildcard for the preceding text in the file name.


Set Variable [$path; Value:Get ( DesktopPath ) & Amplifications::QC01_Plate_ID & "/*" & Amplifications::FA_name_exportable & ".BMP"]

Go to Record/Request/Page [First]


     If [IsEmpty (Amplifications::FA_electropheragram_trace)]

     Insert File [Amplifications::FA_electropheragram_trace; "$path"]

     End If

     Go to Record/Request/Page [Next; Exit after last]

End Loop


The filenames are generated using another software and so I am unable to alter this. Is there a way to ignore the first part of the filename without using "*"?


Thanks in advance!