Linux calculates the number of rows that appear every ten minutes

there is a CSV, that lists the time. I want to count the number of rows that appear every ten minutes (or every 30 minutes). For example, how many pieces are there in 00-00-00-00-09 and 00-00-00-00-19? Count by linux.

clipboard.png

Jun.14,2021

suppose your csv file is called temp.csv, and you can do hourly statistics

.
awk -F":" '{count[$2]PP} END{for(i=0; i<24; iPP){if(i<10){bb=0""i;}else{bb=i;} print bb"\t"count[bb]}}' temp.csv
Menu