Skip to main content
Solved

Select table in mdb database reader using regular expression


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.
View original
Did this help you find an answer to your question?

2 replies

david_r
Evangelist
  • 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
david_r wrote:
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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings