Skip to main content

Dear all,

I have a problem which I cannot solve. I'm pretty new to FME and can't seem to find out a solution for my problem. I have a csv table with attributes such as parcel land numbers and land owners with addresses and so on. I need to export this data to a different files organized by land parcel number. So output is textual files (attribute created with text editor) with data like land parcel no. 2, owners no.1, 2,3 and so on (name, address), area size of the land parcel, things like that. So there will be as many files as there are land parcels. I've stuck because cannot seem to get all the parcel owners for one land parcel number. I get only first one and that's all for that land parcel. I've tried to work it out with list but really don't understand how that works in fme. The other solution is to try looping through that attributes but also stuck there. How do I get all the owners for each land parcel number. Thanks in advance for the help.

Best regards

If I understand correctly, you need a text file per land parcel number. You can accomplish that by using a dataset fanout. See https://knowledge.safe.com/articles/565/fanout-1.html

Without knowing how the text file needs to be structured, I can't give you specific advice, but in general the textfile writer takes one attribute: text_line_data. You can concatenate the information you wish to include from each feature into that attribute.

 

 

So if you CSV had something like

 

parcelID, Owner, Address

 

1, A, 1 1st Ave

 

1, B, 5 2nd Ave

 

2, C, 2 4th Ave

You can set the text_line_date to be @Value(Owner): @Value(Address)

 

and set the dataset fanout to some thing like

 

Destination Fanout Directory: C:\\output

 

Fanout Expression : Parcel@Value(parcelID).txt

 

and you would end up with

 

Parcel1.txt

A: 1 st Ave

 

B: 5 2nd Ave

Parcel2.txt

C: 2 4th Ave


Hi @jjaksic22, maybe I don't understand your requirement correctly, but if you need to concatenate the list elements (owner numbers) and create a comma separated single string, you can use the ListConcatenator transformer.


Alternatively, if you are using an Aggregator to aggregate the csv records grouping by land parcel number, the Attributes to Concatenate parameter in the Aggregator might help you.

If you could show us a part of the source csv table and desired result that should be generated from the part, I think a more precise answer would be provided.


Hi @jdh and @takashi,

thanks for the answers. Sorry for my rusty english, I think I didn't explain my problem well.

So, I thought I could use one csv table, but that's wrong. I have 3 tables. All of them have one attribute common, that's new land parcel number. I will now specify which are the key attributes that need to be aggregated and processed to files.

Firste table attributes:

Parcel number Use of parcel (building, backyard, plowed land) Area size of the use

(here is also possible several uses per parcel number)

Second table attributes:

Parcel number Land owners

Third table attributes:

Parcel number Old parcel number

So far I used feature merger to aggregate all tables, I used first table as requestor and rest two for the supplier. Now begins the problem. I need to have multiple values for the land owners and use of parcel for the specific parcel number. Everything I tried so for using 'generate list' option in feature merger didn't post the required result.

I managed to solve fanout to dataset to create multiple files on my own, sorry I didn't mention that.

Output text should be something like this

Land Parcel No. A

Owners:

Parcel owner (1)

Parcel owner (2)

Parcel owner (3)

Use of parcel: Area size (square meters)

Building 320

Backyard 640

Area sum: 960

Old parcel number:

1031

 

So the bolded text is just text, and the italic text represents attribute or list values. I hope this clarifies problem. Hoping you can help. Thanks in advance.

BR


If you have merged the parcel owners as elements of a list attribute to the first table with the FeatureMerger, I think you can concatenate them with the newline character as delimiter using the ListConcatenator and then construct the entire destination text with the StringConcatanator.


If you have merged the parcel owners as elements of a list attribute to the first table with the FeatureMerger, I think you can concatenate them with the newline character as delimiter using the ListConcatenator and then construct the entire destination text with the StringConcatanator.

It might be simpler if you would aggregate the second table with an Aggregator grouping by parcel number and concatenate owners using the Attributes to Concatenate parameter before merging to the first table.

 


Hi @takashi, your advice was quite helpful. Thank you. I've managed to create text files with all the necessary data (with aggregators), but the formatting I did through text editor doesn't work at all. I mean to say, newline as a constant doesn't create new line. I got all the data in one row. I have used attribute creator transformer and formatted all the data with text editor. New attribute is then connected with text_line_data attribute in text WRITER. Using string concatenator didn't put any data inside text files. Actually, this formatting of data is quite important. Maybe there is another format to be used to work better with this kind of data?

BR


Reply