<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have a lot of csv files with columns of day, time, and temperature</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
such as below.  </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Anytime I have consecutive rows with the same day and time,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
as highlighted below, I was to only keep the last row and remove</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
the other duplicates.  </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Does anyone have any suggestions in NCL or other command line?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I did see this potential solution using sed, but it doesn't work in</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
my mac os environment.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a href="https://unix.stackexchange.com/questions/265540/delete-consecutive-lines-in-csv-with-duplicate-values-in-one-field-but-keep-the">https://unix.stackexchange.com/questions/265540/delete-consecutive-lines-in-csv-with-duplicate-values-in-one-field-but-keep-the</a><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
DAY    TIME   TEMP</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span> 83.,   0.00,  -6.32<br>
</span>
<div> 83.,  60.00,  -6.58<br>
</div>
<div> 83., 120.00,  -6.80<br>
</div>
<div> 83., 180.00,  -7.22<br>
</div>
<div> 83., 240.00,  -7.10<br>
</div>
<div> 83., 300.00,  -7.47<br>
</div>
<div> 83., 360.00,  -7.69<br>
</div>
<div> 83., 420.00,  -7.50<br>
</div>
<div> 83., 480.00,  -6.75<br>
</div>
<div> 83., 540.00,  -5.49<br>
</div>
<div> 83., 600.00,  -4.54<br>
</div>
<div> 83., 660.00,  -3.30<br>
</div>
<div> 83., 720.00,  -2.42<br>
</div>
<div> 83., 780.00,  -1.67<br>
</div>
<div> 83., 840.00,  -1.64<br>
</div>
<div> 83., 900.00,  -2.08<br>
</div>
<div> 83., 960.00,  -2.99<br>
</div>
<div> 83.,1020.00,  -4.07<br>
</div>
<div> 83.,1080.00,  -5.17<br>
</div>
<div> 83.,1140.00,  -6.52<br>
</div>
<div> 83.,1200.00,  -7.60<br>
</div>
<div> 83.,1260.00,  -8.56<br>
</div>
<div> 83.,1320.00,  -8.93<br>
</div>
<div> 83.,1380.00,  -9.65<br>
</div>
<div> 84.,   0.00, -10.13<br>
</div>
<div><span style="background-color: rgb(255, 255, 0);"> 84.,  60.00, -10.29     * want to remove</span><br>
</div>
<div><span style="background-color: rgb(255, 255, 0);"> 84.,  60.00, -10.46     * want to keep</span><br>
</div>
<div> 84., 120.00, -10.72<br>
</div>
<div> 84., 180.00, -10.97<br>
</div>
<span></span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks, Michael</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
Michael Notaro<br>
<div>Associate Director<br>
</div>
<div>Nelson Institute Center for Climatic Research<br>
</div>
<div>University of Wisconsin-Madison<br>
</div>
<div>Phone: (608) 261-1503<br>
</div>
<div>Email: mnotaro@wisc.edu<br>
</div>
</div>
</div>
</body>
</html>