Skip to main content
Solved

Read multiple text files and extract 1 date string from each one of them

  • August 25, 2022
  • 2 replies
  • 115 views

Hi everyone, I know how to read just 1 text file and use StringSearcher to extract string from the content. But how do I read "multiple" text files "automatically" and extract specific string from the content in each one of them?

 

Thanks in advance

Howard

Best answer by nielsgerrits

Multiple ways to do this.

 

My preferred method is to use a FeatureReader (Directory and File Pathnames) to find the files I need followed by another FeatureReader (Text File), using the path_windows attribute to read the selected files.

 

As an alternative you can add a classic Text File reader and choose for the "Select Multiple Folders/Files..." option from the Dataset options.

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

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • Best Answer
  • August 25, 2022

Multiple ways to do this.

 

My preferred method is to use a FeatureReader (Directory and File Pathnames) to find the files I need followed by another FeatureReader (Text File), using the path_windows attribute to read the selected files.

 

As an alternative you can add a classic Text File reader and choose for the "Select Multiple Folders/Files..." option from the Dataset options.


  • Author
  • 1 reply
  • August 25, 2022

Thanks for that. FeatureReader works for me. Now I am able to read thousands of txt files by using FeatureReader 👍 Much appreciated!