<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Hi,</div>
<div class="elementToProof" style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof"><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">you can use the DB Manager for custom layer queries. You can create SQL queries and add those to the layer tree, more information can
 be found here <a href="https://docs.qgis.org/3.34/en/docs/user_manual/plugins/core_plugins/plugins_db_manager.html">
https://docs.qgis.org/3.34/en/docs/user_manual/plugins/core_plugins/plugins_db_manager.html</a></span></div>
<div class="elementToProof"><br>
</div>
<div class="elementToProof"><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">And of course, ordering queries based on custom criteria can be done there via ORDER BY clause ...</span></div>
<div class="elementToProof"><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">HTH</span></div>
<div class="elementToProof"><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">Frank</span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> QGIS-User <qgis-user-bounces@lists.osgeo.org> im Auftrag von Gordon Wakelin-King via QGIS-User <qgis-user@lists.osgeo.org><br>
<b>Gesendet:</b> Mittwoch, 13. März 2024 00:20<br>
<b>An:</b> chris hermansen <clhermansen@gmail.com>; Michael.Dodd <michael.dodd@open.ac.uk><br>
<b>Cc:</b> Frederik-Matti Bartels (CAPSA) <bartels@capsa-building.org>; qgis-user@lists.osgeo.org <qgis-user@lists.osgeo.org><br>
<b>Betreff:</b> Re: [Qgis-user] editing and saving very large table</font>
<div> </div>
</div>
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Aptos}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
        {margin:0cm;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif}
a:link, span.x_MsoHyperlink
        {color:blue;
        text-decoration:underline}
span.x_gmailsignatureprefix
        {}
span.x_EmailStyle20
        {font-family:"Aptos",sans-serif;
        color:windowtext}
.x_MsoChpDefault
        {font-size:11.0pt}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.x_WordSection1
        {}
-->
</style>
<div lang="EN-AU" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="x_WordSection1">
<p class="x_MsoNormal"><span style="font-size:11.0pt">Surely this is something that can be done easily with an SQL Select  with Order-by, in one of the SQL variants that QGIS can use?  </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt">I’m asking for my own benefit too. Having come from the MapInfo environment I would reach for an SQL Select to do this task, but I’m less familiar with SQL in QGIS.
</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><b><span lang="EN-US" style="font-size:8.0pt; font-family:"Arial",sans-serif; color:black">Gordon Wakelin-King</span></b><span lang="EN-US" style="font-size:8.0pt; font-family:"Arial",sans-serif; color:black"></span></p>
<p class="x_MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt"> </span></p>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri",sans-serif"> QGIS-User <qgis-user-bounces@lists.osgeo.org>
<b>On Behalf Of </b>chris hermansen via QGIS-User<br>
<b>Sent:</b> Wednesday, March 13, 2024 8:02 AM<br>
<b>To:</b> Michael.Dodd <michael.dodd@open.ac.uk><br>
<b>Cc:</b> Frederik-Matti Bartels (CAPSA) <bartels@capsa-building.org>; qgis-user@lists.osgeo.org<br>
<b>Subject:</b> Re: [Qgis-user] editing and saving very large table</span></p>
</div>
<p class="x_MsoNormal"> </p>
<div>
<div>
<div>
<div>
<p class="x_MsoNormal">Michael and list,</p>
</div>
<p class="x_MsoNormal"> </p>
<div>
<div>
<p class="x_MsoNormal">On Tue, Mar 12, 2024 at 11:48<span style="font-family:"Arial",sans-serif"> </span>AM Michael.Dodd <<a href="mailto:michael.dodd@open.ac.uk">michael.dodd@open.ac.uk</a>> wrote:</p>
</div>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0cm 0cm 0cm 6.0pt; margin-left:4.8pt; margin-right:0cm">
<div>
<div>
<div>
<p class="x_MsoNormal" style=""><span lang="EN-GB" style="font-size:11.0pt">In this particular instance the data are not spatial data, at this stage at least. There is no link to location.</span><span lang="EN-GB"></span></p>
<p class="x_MsoNormal" style=""><span lang="EN-GB" style="font-size:11.0pt"> </span><span lang="EN-GB"></span></p>
<p class="x_MsoNormal" style=""><span lang="EN-GB" style="font-size:11.0pt">The data does have a hierarchy according to several columns, by sorting I can put the data into a suitable order for editing in further information into an extra column. Without sorting
 the places where the extra info and which specific extra info are impossible to find and check as they are scattered all over.</span><span lang="EN-GB"></span></p>
<p class="x_MsoNormal" style=""><span lang="EN-GB" style="font-size:11.0pt"> </span><span lang="EN-GB"></span></p>
<p class="x_MsoNormal" style=""><span lang="EN-GB" style="font-size:11.0pt">I tried putting the information in using the field calculator and even though the simple expression seemed correct and there was no error message it did not put the information in.
 So I was even thinking of putting the information in by hand once sorted although suspect there may be issues with this too.</span><span lang="EN-GB"></span></p>
<p class="x_MsoNormal" style=""><span lang="EN-GB" style="font-size:11.0pt"> </span><span lang="EN-GB"></span></p>
<p class="x_MsoNormal" style=""><span lang="EN-GB" style="font-size:11.0pt">I was wondering about sorting the whole file then copying out/exporting chunks of a million rows at a time to go into a normal spreadsheet. If the copying out/export would not work
 directly then saving the sorted version of the data and chopping up using e.g. notepad++ and editing with spreadsheet. It is important to do the sorting before chopping up into the 5 separate files.</span><span lang="EN-GB"></span></p>
<p class="x_MsoNormal" style=""><span lang="EN-GB" style="font-size:11.0pt"> </span><span lang="EN-GB"></span></p>
<p class="x_MsoNormal" style=""><span lang="EN-GB" style="font-size:11.0pt">It is only later that spatial information is attached, that is not relevant at this stage as the spatial data will not be attached to all rows.</span><span lang="EN-GB"></span></p>
</div>
</div>
</div>
</blockquote>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal">Ok so you are sorting a text file, presumably something like a .CSV.  Perhaps you are working on Windows.</p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal">What are your options to sort the file before you put it in QGIS?  It seems your spreadsheet won't accommodate the number of lines in your file; what about the "sort" utility in say Windows PowerShell?</p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal">Here's an article that talks about sorting .CSV files that way.</p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal"><a href="https://stackoverflow.com/questions/23603397/sorting-csv-using-windows-sort">https://stackoverflow.com/questions/23603397/sorting-csv-using-windows-sort</a> which in turn refers to this article</p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal"><a href="https://devblogs.microsoft.com/scripting/hey-scripting-guy-how-can-i-use-windows-powershell-to-sort-a-csv-file/">https://devblogs.microsoft.com/scripting/hey-scripting-guy-how-can-i-use-windows-powershell-to-sort-a-csv-file/</a></p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal">Alternatively, if you're using Linux or (I would imagine) OS/X, you can use the Posix "sort" utility.</p>
</div>
</div>
<p class="x_MsoNormal"><span class="x_gmailsignatureprefix">-- </span></p>
<div>
<div>
<p class="x_MsoNormal">Chris Hermansen · clhermansen "at" gmail "dot" com<br>
<br>
C'est ma façon de parler.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>