perl Test_1..pl >"C:/Users/Joe/Documents/Genealogy/birdt.ged.txt" #### #!/usr/bin/perl use strict; use warnings; my $file_in = "C:/Users/Joe/Documents/Genealogy/birdt.ged"; open my $FILE, "<", $file_in or die "could not open $file_in $!"; # three-argument open syntax my @ged = <$FILE>; # slurp the file contents into @ged open my $OUTPUT,'>',$file_in.'.txt.' or die "could not open $file_in.txt $!"; select $OUTPUT; my $count = $.; print "no. of records: $count \n" ; # counting the number of records my $i=0; # stepping through the array $count = 5174 for ($i= 0; $i<$count; $i=$i+1) {print "$i $ged[$i]\n"; }