I have used different sources here on Stack Overflow, for example this, to clean my alarm file (data.txt) from spam and to extract the unique occurences to this file (unik.txt). The next step, where i am stuck, is to use unik.txt and count the number of occurences in data.txt, and to export the string and count to a text or csv-file. As you may have guessed it is a way of creating an alarm statistic. I have considered using other methods/languages but will first want to try this way.
I have read this post also without coming to a close.
Extract from data.txt:
D_TA204_GT1_DV_AL D_TA204_GT41_DV_AL D_TA204_GT31_DV_AL D_TA204_GT21_DV_AL U_TA364_GT11_LARM U_TA364_GT11_LARM U_TA364_GT11_LARM U_FF415_GT46_L_AL U_TA364_GT11_LARM D_TA204_GT31_DV_AL U_KB6_GT11_DV_AL U_FF415_GT46_L_AL D_TA204_GT21_DV_AL U_KB6_GT11_DV_AL TRE-11-11-I033 TRE-11-11-D5394 U_KB6_GT11_DV_AL U_KB6_GT11_DV_AL U_KB6_GT11_DV_AL
Extract from unik.txt:
D_TA204_GT1_DV_AL D_TA204_GT41_DV_AL D_TA204_GT31_DV_AL D_TA204_GT21_DV_AL U_TA364_GT11_LARM U_FF415_GT46_L_AL U_KB6_GT11_DV_AL