Skip to main content
Solved

Use an attribute containing a list of files as FeatureReader Input Dataset

  • April 1, 2016
  • 8 replies
  • 130 views

Forum|alt.badge.img

Hi,

I'm setting up an attribute containing a list of files, and then I want to use it as input Dataset in a FeatureReader.

e.g. the attribute contains the string: "C:\\a.jpg","C:\\b.jpg"

The featureReade will reject the attribute as input Dataset

If I hardcode the same string in the FeatureReader Dataset field it works fine.

I also tried to use a workspace runner to convert the attribute to a Published Parameter as input for a reader, but the same problem appears.

Can anyone help me out?

Best answer by takashi

Hi @kath, try this - separate the quoted paths by a whitespace, and surround the entire string with double quotations.

""C:\a.jpg" "C:\b.jpg""
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.

8 replies

david_r
Celebrity
  • 8391 replies
  • April 1, 2016

Hi

You will have to remove the quotes around the filename in your attribute before passing it on to the FeatureReader. You can use a StringReplacer for this, set "Text to match" as a double quote (") and leave Replacement text empty.

David


Forum|alt.badge.img
  • Author
  • 11 replies
  • April 1, 2016

This doesn't work either. My Attribute is now like

C:\\a.jpg,C:\\b.jpg

but it is rejected as well.


takashi
Celebrity
  • 7842 replies
  • Best Answer
  • April 1, 2016

Hi @kath, try this - separate the quoted paths by a whitespace, and surround the entire string with double quotations.

""C:\a.jpg" "C:\b.jpg""

Forum|alt.badge.img
  • Author
  • 11 replies
  • April 1, 2016

takashi, that's the solution, thank you!


david_r
Celebrity
  • 8391 replies
  • April 1, 2016

This doesn't work either. My Attribute is now like

C:\\a.jpg,C:\\b.jpg

but it is rejected as well.

Aha, I didn't realize that you had several filenames in the same attribute value.


takashi
Celebrity
  • 7842 replies
  • April 1, 2016

takashi, that's the solution, thank you!

Good to hear it works.

In fact, that's a "rule of thumb". I can't explain the reason why it works but comma-separated format doesn't work. Hope someone from Safe to clarify this ;)


Forum|alt.badge.img
  • 14 replies
  • August 27, 2018

Hi,

 

I feel that this post should correspond to what I am trying to do but I do not understand the solution. I want to use a table containing a path attribute and a file name attribute as the source data list.

 

Thank you.

Should I create a unique string of the form "" C: \\ a.jpg "" C: \\ b.jpg "" ...... ?

Thanks


fmelizard
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • August 27, 2018

Hi,

 

I feel that this post should correspond to what I am trying to do but I do not understand the solution. I want to use a table containing a path attribute and a file name attribute as the source data list.

 

Thank you.

Should I create a unique string of the form "" C: \\ a.jpg "" C: \\ b.jpg "" ...... ?

Thanks

If you don't already have a list (you don't) then I'd suggest just reading the input table and making a new attribute out of the concatenation of the path and the filename and then using that as the dataset for the FeatureReader. So in the FeatureReader you'd say that the dataset was coming from an attribute (in fact, you could use the "string editor" to join the parts together right in the FeatureReader's source dataset properties.

 

 

No need to join the rows into one long list -- just feed the individual rows into the FeatureReader and it will do as you desire.