Skip to main content
Question

Textfile Reader

  • February 6, 2013
  • 5 replies
  • 26 views

I have a reader which reads textfile from a specified directory.

 

 

I don't want to have to specify the textfile each time I run the job.

 

 

Can I simply set up a directory published parameter and use this for the reader to process any textfiles within that directory. If it can be done how do I do it.

 

 

Thanks
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.

5 replies

fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • February 6, 2013
Hi,

 

Simply go to the advanced browser (barrel) point to the directory (you can edit the filter to *.txt, if necessary) and thats it (since the source is automatically published).

davideagle
Contributor
Forum|alt.badge.img+22
  • Contributor
  • February 6, 2013
Though if your text files all have different names, which is likely, you'll need to go to your Source FeatureType on the workbench canvas and click the Properties button, then select the tick box to "Merge Feature Type" on the wildcard *. Itay's part allows you to read many txt files, this part allows different file names other than the one defined to pass through the workbench with the benefit of just having one input featuretype on the canvas, rather than 1 per text file...

  • Author
  • February 6, 2013
I have created a published parameter as type Directory (Source) and linked this to the source text file(s) of the reader but I'm getting 'error reading

C:\\Documents and Settings\\CS804PI\\Desktop\\Data Extract

'

  • Author
  • February 6, 2013
I forgot to say that there will only be one textfile per run but the textfile name will be different each time.

 

Thanks

davideagle
Contributor
Forum|alt.badge.img+22
  • Contributor
  • February 15, 2013
Itay's answer should be fine for you then. If there is just 1 file in the folder each time, having the reader set to read from FolderA and *.txt will mean that as soon as your file is available to process you just trigger the workspace to run, not workspace editing required.