Hi,
can you please tell / show us how you're using the AttributeCreator?
As a general rule, I always try to avoid spaces in attribute or field names.
David
Do you use regexp for parsing?
Then u have to escape the spaces, probalby.
>\\d\\w\\s]* would do any combo of digits, wordcharacters and spaces for instance.
I'm guessing it's the parsing that fails on spaces (?)
Gio
As an example, one of the attributes is:
Attribute Name: owner
Value: $(owner)
where $(owner) is the name of the Python scripted parameter. I don't have any spaces in the attribute names, just sometimes in the attribute values -- for example, $(owner) could be "John Doe".
Gio:
I'm not using regexp, I'm just reading the full line for each parameter. Here's an example of my parsing code:
path = (FME_MacroValuesl'SourceDataset_CSV'])
f = open(path, "rb")
owner = f.readline().strip()
f.close()
#print owner
return owner
If I uncomment the print statement, it prints correctly, so it seems like the Python code is working. It only fails when I try to assign it using the AttributeCreator.
Hi,
I'm surprised to hear this, as this is something I do rather frequently.
I just tested in FME 2013 SP4 and it works as it should:
David
David,
I just tried reproducing your workspace and I'm getting the same result as before:
Attribute(encoded: utf-8) : `owner' has value `'
Maybe this is a bug with 2013 SP1? I will try updating to a newer version and see if that makes a difference.
Thanks for your help,
-Matt
Well this is strange...
I installed FME Desktop 2014, and assigning the parameters is mostly working correctly now.
However, it's still acting strange for a few that have parentheses in the parameter value, where it removes all the spaces inside the parentheses for some reason:
Attribute(encoded: utf-8) : `proj_dir_url' has value `Not Available (coordinatefilesarelocalinsteadofinprojectdirectory)'
When I print the value from Python I get the correct formatting:
Not Available (coordinate files are local instead of in project directory)
That is indeed strange.
Was able to reproduce it myself using FME 2014, both using the AttributeCreator and the AttributeRenamer. However, the StringConcatenator works...
Sounds like a bug, consider forwarding it (together with a minimal workspace to reproduce) to Safe support.
David
Thanks David,
I submitted this to Safe support, and in the meantime I will use the StringConcatenator as a workaround.
We've confirmed the issue support and have filed a task with our development team to have a look at this issue. I'll try to notify the group when this is resolved.