Skip to main content
Solved

How to make selection of shp files?


I have about 11 thousand SHP files with unique names and a XLS list with ID that contains in ID field of SHP. How can i select this SHP files that is in XLS list and write them into another folder?

Best answer by markatsafe

Assuming that the ID field is an attribute in your Shape files and all you have in your Excel file is a list of those IDs. I think the quickest way to do this would be:

1. use the DBF reader (rather then the Shape reader) to build an index of ID & directory/file name, as a CSV file or SQLite table.

2. use the Excel reader to look-up the directory/file name and then use the File Copy writer to move your shape files to your target folder.

I'm suggesting the DBF reader instead of the Shape reader since you don't need to read the shape geometries to lookup the ID.

View original
Did this help you find an answer to your question?

6 replies

Forum|alt.badge.img+2
  • Best Answer
  • November 24, 2017

Assuming that the ID field is an attribute in your Shape files and all you have in your Excel file is a list of those IDs. I think the quickest way to do this would be:

1. use the DBF reader (rather then the Shape reader) to build an index of ID & directory/file name, as a CSV file or SQLite table.

2. use the Excel reader to look-up the directory/file name and then use the File Copy writer to move your shape files to your target folder.

I'm suggesting the DBF reader instead of the Shape reader since you don't need to read the shape geometries to lookup the ID.


  • Author
  • November 27, 2017

Where can i get file copy writer? Is this a transformer or its stand alone module?


nielsgerrits
VIP
Forum|alt.badge.img+54
frolovgn55 wrote:

Where can i get file copy writer? Is this a transformer or its stand alone module?

It is a Writer, hit Writers, Add Writer..., enter File Copy in Format Field.

 

You also can click in the Canvas and enter File Copy.

 

Or click in the Canvas and enter FeatureWriter and define File Copy in its parameters.

 


  • Author
  • November 27, 2017

Oh i understand. But what tool do I use to compare the values from the excel and the ID field.


nielsgerrits
VIP
Forum|alt.badge.img+54
frolovgn55 wrote:

Oh i understand. But what tool do I use to compare the values from the excel and the ID field.

FeatureMerger :-)

  • Author
  • November 27, 2017

Thanks. its work good.


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