1

I am trying to set a rule that would move up filled lines and hide an empty line (it can be on any line) in a postal address through PythonCaller transformer. I have a database table consisted of address elements (organisation_name, department_name, house_name, house_number, street_name, specific_locality, town, post_code…) and these elements are somehow ordered on address lines.

Here is an example:

house_name
house_number, street_name

town
post_code

What I need to do now is to hide the empty line in the middle (address_line_3) by moving the last two address lines up (town_line and post_code_line).

So it's going to look like this:

house_name
house_number, street_name
town
post_code

The order of the address elements varies as well as occurrence of the empty lines. Because I am a beginner in Python I can only guess how to do it. If there is any other transformer in FME Workbench I can use, I welcome your ideas.

  • This may be of use. I hope this helps! – user59200 Oct 22 '15 at 8:40
1

I solved this issue by adding 'Tester' and 'AttributeCreator' transformers instead of coding it in 'PythonCaller' transformer. In the Tester I selected 'line3' as a left value (transformers must be connected to see the attributes set previously) and empty string as a right value. In the AttributeCreator I set the lines in order and I added a NULL value for 'line5'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.