Search Results

Search: Posts Made By: fajar_3t3
4,965
Posted By RudiC
Try awk ' /"res:ResultCode":-1/ {sub...
Try awk '
/"res:ResultCode":-1/ {sub (/:[0-9]*,[0-9]*/, " ", $0)
match ($0, /"message":"[^"]*/)
CNT[$1 OFS $2 OFS substr($0, RSTART+11,...
4,965
Posted By RudiC
Again, your sample file doesn't match your...
Again, your sample file doesn't match your expectation. Try
awk '
/"res:ResultCode":-1/ {sub (/:[0-9]*,[0-9]*/, " ", $0)
match ($0, /"message":"[^"]*/)
...
4,218
Posted By RudiC
Tryawk -F: '{sub (/\[/, "", $1); sub (/"}/, "",...
Tryawk -F: '{sub (/\[/, "", $1); sub (/"}/, "", $NF); CNT[$1 ":" $2 " " $NF]++} END {for (c in CNT) print c, CNT[c]}' file
2019-07-18T01:14 Insufficient balance 1
2019-07-18T01:09 Error 1...
1,424
Posted By RudiC
Recent bash? Try echo -e "x...
Recent bash? Try
echo -e "x "{00..23}:{00..59}:{00..59}"\n" | awk '{CNT[$2]++} END {for (c in CNT) print c, CNT[c]-1}' - file | sort
.
.
.
12:02:05 0
12:02:06 2
12:02:07 0
12:02:08 3...
1,424
Posted By Chubler_XL
Try this: awk -F"[ |]" ' ...
Try this:

awk -F"[ |]" '
{cc[substr($2,1,8)]++ }
END {
for(h=0;h<24;h++) for(m=0;m<60;m++) for(s=0;s<60;s++) {
i=sprintf("%02d:%02d:%02d",h,m,s)
print i,cc[i]+0
}}' filesname
1,263
Posted By rdrtx1
awk ' $2 % 5 == 0 && line {print line,...
awk '
$2 % 5 == 0 && line {print line, total; total=0; first=""}
!first {first=$1 ":" $2}
{line=first " - " $1 ":" $2; total+=$NF}
END {if (line) print line, total}
' FS="[: ]" data
2,183
Posted By Scott
This should be possible with just the sort...
This should be possible with just the sort command, but:

$ sort -nrk2 somefile | awk -F: '!A[$1]++'
20:46:23 65
21:46:28 47
22:46:31 38
23:46:37 10
2,183
Posted By garydeena
sort -nr -k2 filename
sort -nr -k2 filename
Showing results 1 to 8 of 8

 
All times are GMT -4. The time now is 08:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy