D
Dan Guzman
I'm updating a process that reads in text file from a mainframe
extract. The script reads and parses out this file and creates html
documents from this data. I'm having a problem when the mainframe put
in a certain character '' the perl script stops running. It's values
are:
hex - 1a
dec - 26
oct - 032
How do I replace these types of characters? Thanks,
Dan
.........
while($mLine=<INPUTFILE>) {
chomp($mLine);
$mLine =~tr/<>/ /; #-replaces <> with a space .
$mLine =~tr/\26/ /;
print $mLine;
if (substr($mLine,0,12) eq "START-REC!!!") {
#- Parse columns and insert to table!
($mTag,$mticket) = split /!!!/,$mLine;
$mticket=~ s/^\s*(.*?)\s*$/$1/;
$mText = "<pre><b><font size=4 color=blue>Ticket :
$mticket</font>\n<font size=1 color=blue>Last Mainframe
Synchronization: $mLastUpdate</font>\n\n</b>";
} elsif (substr($mLine,0,13) eq "!!!END-REC!!!") {
$mText=$mText."\n<b><font size=1 color=blue>Last Mainframe
Synchronization: $mLastUpdate</font></b></pre>";
#- Write $mText to file using the ticket nnumber as filename.
&loadTicketData($mticket,$mText);
print "$mticket\n";
} else {
$mText=$mText.$mLine."\n";
}
}
close(INPUTFILE);
extract. The script reads and parses out this file and creates html
documents from this data. I'm having a problem when the mainframe put
in a certain character '' the perl script stops running. It's values
are:
hex - 1a
dec - 26
oct - 032
How do I replace these types of characters? Thanks,
Dan
.........
while($mLine=<INPUTFILE>) {
chomp($mLine);
$mLine =~tr/<>/ /; #-replaces <> with a space .
$mLine =~tr/\26/ /;
print $mLine;
if (substr($mLine,0,12) eq "START-REC!!!") {
#- Parse columns and insert to table!
($mTag,$mticket) = split /!!!/,$mLine;
$mticket=~ s/^\s*(.*?)\s*$/$1/;
$mText = "<pre><b><font size=4 color=blue>Ticket :
$mticket</font>\n<font size=1 color=blue>Last Mainframe
Synchronization: $mLastUpdate</font>\n\n</b>";
} elsif (substr($mLine,0,13) eq "!!!END-REC!!!") {
$mText=$mText."\n<b><font size=1 color=blue>Last Mainframe
Synchronization: $mLastUpdate</font></b></pre>";
#- Write $mText to file using the ticket nnumber as filename.
&loadTicketData($mticket,$mText);
print "$mticket\n";
} else {
$mText=$mText.$mLine."\n";
}
}
close(INPUTFILE);