Answer the question
In order to leave comments, you need to log in
How to get the number of repeating fields in a text?
Hey! And so the text is in the following message datetime id
form
awk '{print $1}' data.log | sort -t' ' -k3 -rn | uniq -c
Answer the question
In order to leave comments, you need to log in
Thank you! Maybe I didn’t describe what I needed very clearly, but here’s what I wanted
sort -t' ' -k3 data.log | uniq -c | sed 's/^[ \t]*//;s/[ \t]*$//' | awk '{print $1}'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question