$row =~ s#\s+$##; $row =~ s#&+#&#g; $row =~ s#(?<=\|)\|#0|#g;