Skip to main content
Question

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.


jhawks
Contributor
Forum|alt.badge.img+7
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.

9 replies

jhawks
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 28, 2023

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


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • June 28, 2023

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

 

image


jhawks
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 28, 2023
ebygomm wrote:

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


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • June 28, 2023
jhawks wrote:

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


jhawks
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 28, 2023
jhawks wrote:

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?


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • June 28, 2023
jhawks wrote:

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


jhawks
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 28, 2023
jhawks wrote:

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


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • June 28, 2023

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


jhawks
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 28, 2023

That's it! thank you very much!!


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