EZ Inventory: Using Wildcards in FTP and SFTP File Paths

In addition to using date and time variables in the file paths, EZ Inventory also now supports a wildcard variable (asterisk "*" character) when retrieving an inventory feed file from an FTP or SFTP server.

This allows our users to specify which inventory file to use based on a partial match in the filename.  This could really come in handy for files that include a full timestamp in the filename (e.g. stock_20230205_175132.csv).

For example, a merchant might want to update their Shopify inventory every 1 hour, and the supplier also generates a new file every 1 hour but they include the full timestamp in the filename.  So we can match the current hour here, but not the minute and second.

The folder/directory on the FTP/SFTP server might have a list of files that looks like this:

  • stock_20230205_170132.csv
  • stock_20230205_180117.csv
  • stock_20230205_190059.csv

In EZ Inventory, under the "File Path" setting, the merchant can then enter this value: 

  • /ezinventory/stock_{{ YYYY }}{{ MM }}{{ DD }}_{{ HH }}{{ * }}.csv

This will cause the app to pull the file that starts with stock_ + the current date and hour and ends with .csv.

If there are multiple files in the directory matching the same pattern, our app will sort the filenames in descending order and then retrieve the first result.


Related Posts:


Tags: new features, ftp, sftp, ez inventory