my $tempContent = undef; # Holds final XML data in one line while (){ my $xml = $_; chomp($_); while($xml=~m/\<(.+?)\>(.+?)\<\/\1\>/sig){ my $tag=lc(strip($1)); ## Below line is the selective condition to ignore all header XML tags and consider only data next if ( $tag =~ /TotalAmount|NoOfRecords|TotalBatch|CurrentBatch|EODTransactionDate|BankFileSeqNo|TotAmount/i ); my $attribs="?"; my $value=strip($2); $tempContent .= qq~$value~; } $tempContent .= qq~\n~; open(OUT,">tmp") or die "Unable to open $! \n"; print OUT $tempContent; close OUT; CRC32 ( tmp) ; # this one can be ignored , i have no problem here #Showing on trasaction, but in daily there are plenty __DATA__ 100 12989898900 08876 S MARR SON ABG89097 INR 0000000000221000000.00 2008-07-10T12:04:25 2008-07-10 /CUST/ ADH7870822 /FRASER TRANSACTION 1780 1000 N 1 # FInal data will be as below 1001298989890008876S MARR SON ABG89097INR0000000000221000000.002008-07-10T12:04:252008-07-10/CUST/ADH7870822/FRASER TRANSACTION17801000N1 # Will calculate checksum for above one line