R
rxl124
I have files that I only need one field that I need to grep it out and
I am trying to assign that to another file.
(It happens that one field that I am looking for has some other character
that I dont need so I am pulling it out w/ substr commands).
However --> @real_num = substr($num, 91,10) is only pulling the last line
of the file(not the 100 other lines).
Can someone please tell me what I am doing wrong here?
Please Please help as I am driving myself mad on this one.
#!/usr/bin/perl -w
open(FH, "files.txt") || die;
@yahoo = <FH>;
foreach $num (@yahoo){
@real_num = substr($num ,91, 10);
}
open(NF, ">hanabbs2.log") || die;
foreach $num (@real_num){
print NF "$num\n";
}
close(NF);
I am trying to assign that to another file.
(It happens that one field that I am looking for has some other character
that I dont need so I am pulling it out w/ substr commands).
However --> @real_num = substr($num, 91,10) is only pulling the last line
of the file(not the 100 other lines).
Can someone please tell me what I am doing wrong here?
Please Please help as I am driving myself mad on this one.
#!/usr/bin/perl -w
open(FH, "files.txt") || die;
@yahoo = <FH>;
foreach $num (@yahoo){
@real_num = substr($num ,91, 10);
}
open(NF, ">hanabbs2.log") || die;
foreach $num (@real_num){
print NF "$num\n";
}
close(NF);