[PLUG] Correcting duplicate strings in files

Rich Shepard rshepard at appl-ecosys.com
Wed Jun 20 12:40:36 UTC 2018


On Tue, 19 Jun 2018, david wrote:

> cat $file | uniq -u > $outfile

David,

   The above prints only the unique lines. I, too, have used this after grep
to remove duplicates.

   With the data referenced in this thread uniq will not do the job because
either each line is unique as a whole (same date, same hour, different
value) or considered a duplicate (same date, same hour, same value). The
former removes nothing, the latter removes the value for 5:00 pm.

   The need is to replace only the second duplicated 16:00 hour with 17:00.

Regards,

Rich



More information about the PLUG mailing list