open (DATA,"PAD.txt") || die ("Can't Open data File \n"); @data=; close DATA; &header_response; $x=0; foreach $line (@data) { $x++; ($Router, $itemgroup, $itemid, $SFC, $LogOp, $timestamp, $ncdescription, $nccode, $operator, $comment1, $comment2)=split(/\|/,$line); if (($comment1 =~ " ") && ($comment2 =~ " ")) { print "$x$Router$itemgroup$itemid$SFC$LogOp$timestamp$ncdescription$nccode$operatorn/an/a \n"; } elsif (($comment1 != " ") && ($comment2 =~ " ")) { print "$x$Router$itemgroup$itemid$SFC$LogOp$timestamp$ncdescription$nccode$operator$comment1n/a \n"; } else { print "$x$Router$itemgroup$itemid$SFC$LogOp$timestamp$ncdescription$nccode$operator$comment1$comment2 \n"; } } &footer_response;