#!/bin/bash

for log in $(ls s*_zone_debug_warning_20211208_20211209_sort.log | sort); do 
	echo ${log}; 
	set_id=$(echo ${log}|sed 's/_zone_debug_warning_20211208_20211209_sort.log//;s/s//'); echo "SET${set_id}"; 
	cat ${log} | perl -ne 'print "$1,$2\n" if /\d+,\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2},\[WARN\]--\[LIFE\]-- \[LIFE:(\w+)\,(\d+)\]\S+ Warning! Cast Skills while moving!! \[PlayerFactory.cc:548\]/' | sort | uniq -c | sed "s/^[ \t]*//;s/ /,/" | sort -n -k1 -r > /home/g1admin/www/download/g1en_z_debug_warning_20211209/simple/s${set_id}_zone_debug_warning_20211208_20211209_players.log;
done
