Skip to main content
Fanout expression using wildcards?: Need to split a shapefile into six shapefiles based on the third character in this string: US5ME54M. That 3rd character can be one of six characters, 1 thru 6.

Thus if cell name = US6whatever write it to the 6 shapefile, US5whatever write it to the 5, etc.


You can just create a fanout attribute using the @Substring expression

 

image


You can just create a fanout attribute using the @Substring expression

 

image

Thanks! Though I don't quite have the Attribute Value correct. So Value gets the CELL ?

image


Thanks! Though I don't quite have the Attribute Value correct. So Value gets the CELL ?

image

If the attribute containing the string is called CELL then you want

@Substring(@Value(CELL),2,1)

 @Value(CELL) is the string to use

2 is the start index (index starts at 0 so this is the third character)

1 is the number of characters to keep from that point


Thanks! Though I don't quite have the Attribute Value correct. So Value gets the CELL ?

image

Still no go. AttributeCreator (AttrSetFactory): An error occurred while evaluating the above expression. If the failed expression is arithmetic, check to ensure there is a numeric value specified as the substitution value for null, empty and missing attributes.

AttributeCreator (AttrSetFactory): AttributeCreator: Failed to evaluate input expression: @Substring(@Value(CELL),6,5,4,3,2,1)

Does it need to know it's splitting on the 3rd character?


Thanks! Though I don't quite have the Attribute Value correct. So Value gets the CELL ?

image

I've added some explanation to my above post, you should enter it exactly as i posted


Thanks! Though I don't quite have the Attribute Value correct. So Value gets the CELL ?

image

Writing, but still not splitting, creates 6 duplicate shapes.image


Once you've got an attribute to Fanout on, you use this as the Shapefile Name within the writer. You only need one writer.

image


That's it! thank you very much!!


Reply