#!/usr/bin/perl -w use strict; use Text::CSV_XS qw(combine); use URI::Escape; die "Usage: perl $0 [input_file.gz] \n" unless @ARGV; my($input_file) = @ARGV; open(my $FH, "zless $input_file| grep as3|") or die $!; my $csv = Text::CSV_XS->new; print map { if($csv->combine(@$_)) { $csv->string, "good\n"} else { "failed \n" }; } sort { $a->[2] <=> $b->[2] } map { $_ = uri_unescape(scalar $_); #tr/\x00//d; #tr/\xE4\xF1\xEC//d; #tr/\xA7//d; #tr/\xF6\xF6\xF9\xE9\xC7//d; #because Text::CSV_XS "failed to combine" [ m{ (\[ # start date [^\]]+ # date \]) # end of date [^=]+ # stuff which is not a = = (.+?) # The message &src=\+ (\d+) # The number }x ] } <$FH>;