We changed over from MindAlign to Symphony Chat at work. Symphony seems akin to ZenDesk chat software. We use the Symphony Chat to assign tickets to people.
When I cut and paste from the Symphony terminal it comes out like this (it has no newlines - it is just one big contiguous line of text):
16th Jun 2020 7:57:18 am Tom Lewin: WJ: RE: BART failed STP - JIMBCI - INC101981467816th Jun 2020 8:20:38 am Nathan Winslow: II : RE: Loans are experiencing issues sending RUNZ - INC101981521816th Jun 2020 8:57:58 am Nathan Winslow: NW : RE: FW: Missing pool factor PnL [Restricted - Internal] - INC101981603016th Jun 2020 9:13:49 am Nathan Winslow: JK : RE: missing sales credits - INC101981633816th Jun 2020 9:24:26 am Nathan Winslow: KB : RE: Bookbuilder not responding - INC1019816567
So I wrote this script to form it better - it works fine.
#!/usr/bin/perl
use warnings ;
use strict ;
my $filename = shift @ARGV ;
open(my $fh, '<', $filename) or die "Could not open file
$filename $!";
while (my $line = <$fh>) {
chomp $line ;
my @words = split /(\d{2}(?:st|nd|rd|th) \w{3} \d{4})/a, $line;
foreach my $word(@words) {
if($word =~ /\d{2}(?:st|nd|rd|th) \w{3} \d{4}/a) {
chomp $word ;
print $word ;
}
else { print "$word\n"; }
}
}
This is the output. Which is fine - however I find myself spending too much time cleaning up the data.
16th Jun 2020 7:57:18 am Tom Lewin: WJ: RE: BART failed STP - JIMBCI - INC1019814678
16th Jun 2020 8:20:38 am Nathan Winslow: II : RE: Loans are experiencing issues sending RUNZ - INC1019815218
16th Jun 2020 8:57:58 am Nathan Winslow: NW : RE: FW: Missing pool factor PnL [Restricted - Internal] - INC1019816030
16th Jun 2020 9:13:49 am Nathan Winslow: JK : RE: missing sales credits - INC1019816338
16th Jun 2020 9:24:26 am Nathan Winslow: KB : RE: Bookbuilder not responding - INC1019816567
This is the problem - this is the output I need:
06/16/2020 WJ: RE: BART failed STP - JIMBCI - INC1019814678
06/16/2020 II : RE: Loans are experiencing issues sending RUNZ - INC1019815218
06/16/2020 NW : RE: FW: Missing pool factor PnL - INC1019816030
06/16/2020 JK : RE: missing sales credits - INC1019816338
06/16/2020 KB : RE: Bookbuilder not responding - INC1019816567
I have tried regex's and splitting the lines but it is just a big mess. The WJ NW JK KB II those are initials - they are constant. Sometimes they have a space after the colon (:), sometimes they don't. However all I need is the Date and the Data starting at the Initial and ending at the last digit of the ticket number INC00000000.