The last line of the following program is not able to read the file Data file = MultiLineData.txt 19760 Austria 7800 Kingsland 124 Petrie Terrace 19762 19764 19765 19767 Austria 7864 Kingsland 1/249 Coronation Drive 19768 19770 Austria 7853 Kingsland Lawrence: 103 Frasers Rd 19771 19775 Austria 7800 Kingsland 127 Edward Street 19777 19779 19780 Austria 7963 Kingsland 133 King Street 19782 19784 19785 19787 19789 19791 Austria 7800 Kingsland Riverside Centre Level 29 123 Eagle Street 19793 19795 19796 19799 67301 67302 67304 Austria 7810 Kingsland Argyle Office Suit 9 20 Argyle Street 67306 67308 #### use strict; use warnings; my $dir = 'C:\Scripts'; open(my $fh1, '<', "$dir\\MultiLineData.txt") or die $!; open(my $out1, '>', "$dir\\work.txt") or die $!; open(my $fh2, '<', "$dir\\work.txt") or die $!; while (my $row = <$fh1>) { chomp $row; my $str = $row; $str =~ s/\t/|/g; print $out1 "$str\n"; } while (<$fh2>){chomp $_; print "$_\n"};