Applying Regex Filtering on File Names in SFTP Sender Adapter – SAP Cloud Integration

Applying Regex Filtering on File Names in SFTP Sender Adapter – SAP Cloud Integration

When using the SFTP Sender Adapter in SAP Cloud Integration, you can filter files based on patterns. Regex filtering provides a powerful way to match specific file names when polling an SFTP server. Here’s how you can configure it:


Steps to Enable Regex Filtering

  1. Directory Path: Provide the relative directory path to read files, e.g., parentdir/childdir.
  2. Enable Regex Filtering Under Source Tab, select the Regex Filtering checkbox.This ensures the file name field is treated as a regular expression rather than a simple pattern.
  3. Define File Name: Input your regex expression in the File Name field.


Regex Filtering Examples:

  1. Match Specific Patterns: ^file\d+\.txt$ → Matches files like file1.txt, file123.txt.
  2. Include Subdirectories: Use patterns like .*subdir.*\.csv to include files from nested directories.
  3. Exclude Files: Combine patterns like ^(?!exclude).*\.xml to avoid files starting with "exclude".
  4. Wildcard Equivalent: .*\.log → Matches all .log files.


Important Notes:

  • Ensure the regex syntax is correct; invalid patterns may cause errors.
  • A 5-second timeout is set for regex evaluation.
  • Avoid overly complex patterns to ensure performance efficiency.


Example Configuration:

  • Directory: data/input
  • Regex Filtering: Checked
  • File Name: ^report_\d{4}-\d{2}-\d{2}\.csv$Matches files like report_2024-06-17.csv.


Regex filtering in the SFTP sender adapter simplifies file processing by enabling precise control over which files to pick during polling. This is especially useful for dynamic integration scenarios where file naming follows a specific pattern.


Let me know if you'd like additional examples or configurations! ??

Reference https://help.sap.com/docs/integration-suite/sap-integration-suite/configure-sftp-sender-adapter#loio2de9ee58737247969eb7dc9e68b1b121__sftp_regex

Anusha Ramsiva

SAP Integration Architect- SAP PI,PO(NWBPM) | SAP CPI | Cloud Workflow | BRM | API Management, TOGAF 9 Certified

2 个月

PI has it and a much awaited feature in CPI

Sujith M.

Integration Architect | SAP Certified | ITIL Certified | TOGAF | SAP Integration Suite | Managed Gateway - Spend and Network | CPI | CIG | SAP API Management | APIGEE

2 个月

Very helpful

Midhun Munagala

SAP Integration | Application Development Senior Analyst

2 个月

Very informative

Abhishek Waje

SAP CPI | SAP PI/PO Developer | Infosys Ltd

2 个月

Very informative.

要查看或添加评论,请登录

Mahesh D.的更多文章

社区洞察

其他会员也浏览了