Skip to main content
Question

Batching combining a1.shp, a2.shp, a3.shp and b1.shp, b2.shp and so on into a.shp and b.shp.

  • November 10, 2017
  • 3 replies
  • 12 views

Hi

I have a few thousand shape-files arranged in pairs of 5 in the form of a1.shp, a2.shp, a3.shp...... and b1.shp, b2.shp..... and so on. I would like to batch merge these into a.shp, b.shp and so on.

Some guidance on how to create this batch would be much appreciated.

Best regards, robin123

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • November 10, 2017

Hi @robin123,

You can use the option Generate Workspace:

On Reader - Dataset: you can choose all shapefiles from a ( a1.shp, a2.shp,a3.shp ):

Thanks,

Danilo


danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • November 10, 2017

Hi @robin123,

I create dynamic Workspace for you.

The Reader was configurated to read a Folder. My folder:

I used the transformer Tester to filter by fme_basename:

I attached the Workspace.

Thanks, - workspace-shape.fmw

Danilo


erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • November 10, 2017

You can read all shape files (*.shp) (assuming they have the same schema) in dynamic mode..

Then use a SubstringExtractor (index 0 - 0) to get the first character of the file name from fme_basename.

Then set the name of the output to the _substring attribute (created in the SubstringExtractor).