Skip to main content
Best Answer

Select table in mdb database reader using regular expression

  • August 2, 2019
  • 2 replies
  • 85 views

tjak003
Contributor
Forum|alt.badge.img+3

Hello community,

I have a folder with all .mdb files that I want to process independently. Therefore I am using a 'directory and file pathnames' reader together with a workspace runner. So every file is send to another workbench, where it will be processed.

In this 'other' workbench I have a 'Microsoft Access' reader, with the 'Single Merged Feature Type' box switched on. When I select the table name myself it works all perfectly. However, here comes the trick. The table names that I am using are different for each incoming file. For example the table name for file 1 could be trees_abc, for file 2 monumental_trees_abc and for file 3 tree_export_abc.

The table names have one thing in common. They contain the word tree and always end with _abc. This regular expression should catch all the possibilities: ^(\\w+|)tree\\w+_abc (so it has the word tree somewhere and always ends on _abc). Now I was wondering if I could implement this regular expression somewhere in the .mdb reader? Or is there I workaround that I am missing? I checked some similar topics on the forum already, but none cover my question.

If there are any questions, let me know. I am looking forward to your suggestions.

Kind regards,

Tim

Best answer by david_r

One option would be to use the "Schema (Any Format)" reader to retrieve the table names from the Access file. Then use a Tester or StringSearcher to check for your expression and then send the table name to a FeatureReader to get the actual contents.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • Best Answer
  • August 2, 2019
One option would be to use the "Schema (Any Format)" reader to retrieve the table names from the Access file. Then use a Tester or StringSearcher to check for your expression and then send the table name to a FeatureReader to get the actual contents.

tjak003
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • August 2, 2019
One option would be to use the "Schema (Any Format)" reader to retrieve the table names from the Access file. Then use a Tester or StringSearcher to check for your expression and then send the table name to a FeatureReader to get the actual contents.

Works perfectly! Thanks a lot.