<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Hi Gavin,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>Can you have the row written to two files concurrently? One as an append & one overwrite.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span> </span><span><span>Both watched in QGIS</span> & have the overwrite as the upper layer on the map with a different symbol, thus overwriting the trackline point in the append csv file.</span></div><div style="color: rgb(0, 0, 0); font-size:
 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>Not as elegant as an SQL solution, but csv's are not really reknowned for their elegance in data management :-)</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">I haven't really thought this through, but you might try using a named pipe (see mkfifo on Linux, Windows has
 something along these lines too), & run "tail -n 1 -f myfile.csv" into the named pipe, then open this in QGIS. This is such a horrible solution it's almost certain not to work, but you never know :-) <br><span></span></div><div><br></div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">Cheers,</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">   Brent<br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span
 style="font-weight:bold;">From:</span></b> Gavin Macaulay <gavin@macaulay.co.nz><br> <b><span style="font-weight: bold;">To:</span></b> qgis-user@lists.osgeo.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, March 11, 2014 9:18 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [Qgis-user] Labelling expressions: how to select the 'last' row in      a csv dataset<br> </font> </div> <div class="y_msg_container"><br>Hi,<br><br>I have a csv file that looks like this:<br><br>datetime, latitude, longitude, speed<br>2014-03-07T06:11:56.794000, 69.6930, 19.0321, 0.0<br>2014-03-07T06:12:56.791000, 69.6904, 19.0291, 10.0<br>2014-03-07T06:13:56.787000, 69.6879, 19.0257, 10.0<br><br>A new row gets added to the file every second or so. I load this file <br>into QGIS as a csv file with the watch option turned on so that every <br>time the map is refreshed, the map plots any new points that have been <br>added to the file.<br><br>I
 would like to have the most recent line in the file plotted with a <br>different symbol to the rest (the data represents realtime data from a <br>moving ship so it's good to highlight the latest position). I can almost <br>do this using the expression based labelling, but not quite (I can get a <br>row number, but not the total number of rows, so can't do something <br>obvious like: $rownum == $numrows, or $id == max($id)).<br><br>Any suggestions on how I can achieve this? I could move the data into a <br>SQL-based layer and choose the last row using an SQL statement, but the <br>simplicity of generating the csv files is attractive.<br><br>Thanks<br><br>Gavin<br>_______________________________________________<br>Qgis-user mailing list<br><a ymailto="mailto:Qgis-user@lists.osgeo.org" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user"
 target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br><br><br></div> </div> </div>  </div></body></html>