<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi</p>
<p>For your listing, although it would not provide the file type i.e. point, line, polygon etc, you could simply create a DOS batch command (dir/s *.shp > shapefilelist.txt) to locate all the file and generate a list of their locations. Then parse these through to the merge vector layer. If you are merging them all into a Geopackage, then file type would not be relevant and you could then sort them once they are in a single location. I don't think the Geopackage would have a limitation on the number of files and records in it.</p>
<p>Perhaps this can assist.</p>
<div id="signature">---<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Regards,<br /><br />Nigel Berjak<br />S3 Technologies<br />Geographic Information Systems & Large Format Printing specialists<br />T: +27 33 3423681<br />F: +27 86 6721242<br />E: <a href="mailto:nigel@S3.co.za">nigel@S3.co.za</a><br />Website: <a href="http://www.S3.co.za" target="_blank" rel="noopener noreferrer">http://www.S3.co.za</a><br /><br />Please consider the environment before printing this email.</div>
</div>
<p><br /></p>
<p id="reply-intro">On 2024-05-10 04:06, Nyall Dawson via QGIS-User wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div dir="ltr">
<div dir="ltr"> </div>
<br />
<div class="v1gmail_quote">
<div class="v1gmail_attr" dir="ltr">On Fri, 10 May 2024 at 09:06, Tony Shepherd (FarmMaps NZ) via QGIS-User <<a href="mailto:qgis-user@lists.osgeo.org" rel="noreferrer">qgis-user@lists.osgeo.org</a>> wrote:</div>
<blockquote class="v1gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">
<div class="v1msg8596937801374573577">
<div lang="EN-NZ" style="overflow-wrap: break-word;">
<div class="v1m_8596937801374573577WordSection1">
<p class="v1MsoNormal">Hi</p>
<p class="v1MsoNormal"> </p>
<p class="v1MsoNormal">I have loads, literally thousands, of SHP, GPKG, TAB files located in loads of different folders and sub-folders.</p>
<p class="v1MsoNormal"> </p>
<p class="v1MsoNormal">Is there a plugin that will trawl through a set of folders, copy say just the polygons from each file into a new file, and populate a field with say the filename and folder the polygon(s) came from?</p>
<p class="v1MsoNormal"> </p>
<p class="v1MsoNormal">Essentially combining a heap of files into one with some metadata about where the data came from?</p>
<p class="v1MsoNormal"> </p>
<p class="v1MsoNormal">Why?  I have files from clients dating back about 20 years.  Clients sell properties.  Properties get subdivided.  New clients come and see us, and often we don't realise we have GIS info on file for that property from many years ago, usually under a different name.  It would be handy to see a polygon on the screen and easily go back to some old GIS data.</p>
<p class="v1MsoNormal"> </p>
<p class="v1MsoNormal">Maybe I am missing an easy tool to do this, but I can't see anything obvious.</p>
</div>
</div>
</div>
</blockquote>
<div> </div>
<div>You could use the "Merge Vector Layers" tool from the Processing toolbox, that does everything you want. The trickiest bit would be getting a master list of ALL your shapefiles/etc you want to combine and passing this to the tool. It's not going to be easy from the GUI itself, as that only allows you to add files from a single folder at once.</div>
<div> </div>
<div>I'd run the tool on the files from a single folder, then checkout the processing history dialog and copy the python command which corresponds to what you just did. You could then adapt this command to pass a complete list of all the files you want to combine. (It's quite straightforward in Python to build a list of files which recursively match a file pattern -- see eg <a href="https://stackoverflow.com/a/2186565" target="_blank" rel="noopener noreferrer">https://stackoverflow.com/a/2186565</a> )</div>
<div> </div>
<div>Hope that helps!</div>
<div>Nyall</div>
<div> </div>
<blockquote class="v1gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">
<div class="v1msg8596937801374573577">
<div lang="EN-NZ" style="overflow-wrap: break-word;">
<div class="v1m_8596937801374573577WordSection1">
<p class="v1MsoNormal"> </p>
<p class="v1MsoNormal"> </p>
<p class="v1MsoNormal"><span> </span></p>
<p class="v1MsoNormal"><span>Cheers</span></p>
<p class="v1MsoNormal"><span>Tony</span></p>
<p class="v1MsoNormal"><span> </span></p>
<p class="v1MsoNormal"><span>------------------------------------------------------------------------------------------------------------------</span></p>
<p class="v1MsoNormal"><strong><span style="color: #404040;">Tony Shepherd</span></strong><span style="color: #595959;"></span></p>
<p class="v1MsoNormal"><em><span style="color: #595959;">  GeoSpatial Manager @ FarmMaps NZ & Photographer @ Shepherd Photos</span></em></p>
<p class="v1MsoNormal"><span style="color: #595959;"> </span></p>
<p class="v1MsoNormal"><strong><em><span style="color: #595959;">Phone</span></em></strong><span style="color: #595959;"> <strong>–</strong> 027 435 6193  | <strong><em>Website</em> – </strong><a href="http://shepherdphotos.co.nz/" target="_blank" rel="noopener noreferrer"><span style="color: #0563c1;">shepherdphotos.co.nz</span></a></span></p>
<p class="v1MsoNormal"><strong><em><span style="color: #595959;">Email</span></em></strong><strong><span style="color: #595959;"> – Maps</span></strong><span style="color: #595959;"> <a href="mailto:tony@farmmaps.nz" rel="noreferrer"><span style="color: #0563c1;">tony@farmmaps.nz</span></a>  |  <strong><em>Email</em> – Photos</strong>  <a href="mailto:tony@shepherdphotos.co.nz" rel="noreferrer"><span style="color: #0563c1;">tony@shepherdphotos.co.nz</span></a></span></p>
<p class="v1MsoNormal"><strong><em><span style="color: #595959;">Facebook</span></em></strong><span style="color: #595959;"> <a href="https://www.facebook.com/TonyShepherdPhotos" target="_blank" rel="noopener noreferrer"><span style="color: #0563c1;">TonyShepherdPhotos</span></a></span></p>
<p class="v1MsoNormal"><span style="color: #595959;"> </span></p>
<p class="v1MsoNormal"><span style="color: #595959;"> </span></p>
<p class="v1MsoNormal"><span style="color: #595959;"><img id="v1m_8596937801374573577Picture_x0020_1" style="width: 1.6666in; height: 0.7812in;" src="cid:1715320968663db8882c61f873476984@s3.co.za" alt="FM_logo1_small (Custom)" width="160" height="75" border="0" /></span></p>
<p class="v1MsoNormal"> </p>
</div>
</div>
_______________________________________________<br />QGIS-User mailing list<br /><a href="mailto:QGIS-User@lists.osgeo.org" rel="noreferrer">QGIS-User@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></div>
</blockquote>
</div>
</div>
</div>
<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br />QGIS-User mailing list<br /><a href="mailto:QGIS-User@lists.osgeo.org">QGIS-User@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></div>
</blockquote>
</body></html>