in reply to Issue in parsing data from file

Consider using unpack to split the lines into fixed width columns

#!/usr/bin/perl use strict; use warnings; my $infile = 'CASH_REPORT-cfpd0903.txt'; # columns # 1111111111 # GENERAL BT # 00318 # 06/08/19 # CSH DEP open my $fh,'<', $infile or die "Could not open file '$infile' : $!"; while (my $row = <$fh>){ my @col = unpack "a14 a27 a11 a11 a9",$row; print join '|',@col,"\n" if $col[4] =~ /CSH DEP/; }
poj