Skip to main content
Question

How to load text data lines into an attribute?


Forum|alt.badge.img

I have a bunch of text files and each files contain one feature different attributes. I want to load the first line data as the first attribute, the second as the second attribute. Could you please give me ahint how to implement it? Here is the process, that I am using:

2 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • August 9, 2019

So, if each text file is representing one feature, you can use the Aggregator transformer to create a list of all the text lines on the one feature.

Then use the AttributeManager transformer to copy the list elements to the right attribute name, like _list{0} to Attribute1, _list{1} to Attribute2 ........

For more complex situations you can also consider using the SchemaMapper transformer, but that one is harder to grasp.

Hope this helps.


takashi
Influencer
  • August 12, 2019

Hi @gylona, not clear what the requirement is. Could you please explain more specifically?

If you have these two text files, for example, what result you need?

text1.txt (2 lines)

abc
xyz

text2.txt (3 lines)

111
222
333

If the examples above weren't appropriate to explain your situation, please post better examples.


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