Exclude temporary file during import multiple data step

Hi EasyMorph Team/Community,

I’m trying to import multiple excel spreadsheet from a folder, and I noticed that every time someone is in one of the spreadsheets, a new temporary file appears in the folder (file name with ~$):

This causes error during the import step with the following error message:

Error: An error occurred while importing file [File Name]: File has wrong format. End of Central Directory record could not be found.
Source: action “Import Excel spreadsheet”, table “Imported table 1”

Is there any way to exclude these temporary files from the import step at all?

Thank you in advance.

Mario

You can use Skip actions on condition with condition like startswith([File name],"~")

1 Like

Hi, Mario.

You can use a RegEx expression to filter out any of the temporary files starting with “~”.

Under “Selection mode” at the top, switch to “Search”. Use the down arrow to the left of the text box below the buttons and select “Regexp” (Regular Expression). Enter the following RegEx pattern:
^[^~]+$

I’m no RegEx wizard, but that should read as: "looking from the start of the string, select strings that do not include the “~” character. More or less.

Sharing two screen clips of a file list I have that includes two temp files at the bottom - before and after applying the RegEx filter. You’ll note the bottom/temp files drop out of the list.

With temp files:

Temp files filtered out:
image

As there isn’t a file extension filter in play here - and it doesn’t look like you have one set in your original post - you’ll just have to be sure that all files in the folder are EasyMorph-readable (unlike my list of files that includes .docx and .pdf files).

Hope that helps!

Craig

1 Like

David’s method managed to solve the issue for me.
Thank you all for your help!