but if they appear in the file in a different sequence then you also
need to rewind and start looking at the beginning of the file once
again like this:
ID:
foreach my $prime_id ( @id_hits ) {
while ( my $line = $AFILE ) {
if ( $line =~ /$prime_id/ ) {
print $line\n;
Steve Bertrand wrote:
but if they appear in the file in a different sequence then you also
need to rewind and start looking at the beginning of the file once
again like this:
ID:
foreach my $prime_id ( @id_hits ) {
while ( my $line = $AFILE ) {
if ( $line =~ /$prime_id/ ) {
On 5/9/07, Rob Dixon [EMAIL PROTECTED] wrote:
Steve Bertrand wrote:
but if they appear in the file in a different sequence then you also
need to rewind and start looking at the beginning of the file once
again like this:
ID:
foreach my $prime_id ( @id_hits ) {
while ( my $line =
Hi Guys
Following is a log file extract which I desperately need to covert to
coma separated for an entire logile called access.log (squid proxy log)
for reporting purposes. There has been some internet surfing abuse on a
client's network.
1178606984.937 1 192.168.1.55 TCP_DENIED/407 1904
Robert Hicks schreef:
open my $IFILE, '', $IDFILE || die Could not open $IDFILE: $!;
This doesn't mean what you assume it does. It is a mix up of:
open(my $IFILE, '', $IDFILE) || die Could not open $IDFILE: $!;
and
open my $IFILE, '', $IDFILE or die Could not open $IDFILE: $!;
--
I decided to back up a bit and try a more simple routine. I have the
array @id_hits populated and I can search the log for the line and print
it. The problem is it only finds the first match and that is it.
foreach my $prime_id ( @id_hits ) {
while ( my $line = $AFILE ) {
if (
, May 8, 2007 4:39:12 PM (GMT+0200) Auto-Detected
Subject: Re: looping through a file
I decided to back up a bit and try a more simple routine. I have the
array @id_hits populated and I can search the log for the line and print
it. The problem is it only finds the first match
-Original Message-
From: [EMAIL PROTECTED]
Sent: May 8, 2007 9:54 PM
To: [EMAIL PROTECTED]
Cc: beginners@perl.org
Subject: Re: looping through a file
my @lines = $AFILE;
foreach my $prime_id ( @id_hits ) {
foreach my $line( @lines ) {
if ( $line =~ /$prime_id
Robert Hicks wrote:
I decided to back up a bit and try a more simple routine. I have the
array @id_hits populated and I can search the log for the line and print
it. The problem is it only finds the first match and that is it.
foreach my $prime_id ( @id_hits ) {
while ( my $line = $AFILE
Jeff Pang wrote:
-Original Message-
From: [EMAIL PROTECTED]
Sent: May 8, 2007 9:54 PM
To: [EMAIL PROTECTED]
Cc: beginners@perl.org
Subject: Re: looping through a file
my @lines = $AFILE;
foreach my $prime_id ( @id_hits ) {
foreach my $line( @lines ) {
if ( $line
Rob Dixon wrote:
Robert Hicks wrote:
I decided to back up a bit and try a more simple routine. I have the
array @id_hits populated and I can search the log for the line and
print it. The problem is it only finds the first match and that is it.
foreach my $prime_id ( @id_hits ) {
while (
I have one file that contains a log. I do a substr to get the
information out of that and push it into an array.
I have a second file that contain another log. I need to loop through
the items in the array and find them in this log. Once I find the line
that the id is on, I need the next line
On 5/7/07, Robert Hicks [EMAIL PROTECTED] wrote:
I have one file that contains a log. I do a substr to get the
information out of that and push it into an array.
I have a second file that contain another log. I need to loop through
the items in the array and find them in this log. Once I find
Chas Owens wrote:
On 5/7/07, Robert Hicks [EMAIL PROTECTED] wrote:
I have one file that contains a log. I do a substr to get the
information out of that and push it into an array.
I have a second file that contain another log. I need to loop through
the items in the array and find them in this
On 5/7/07, Robert Hicks [EMAIL PROTECTED] wrote:
snip
I think part of the problem is the 'shift'ing that I was doing. I am
looking into that. Basically I was shift'ing the @log out of existence
after the first pass.
snip
That sounds like a viable candidate for the warning as well.
snip
Chas Owens wrote:
On 5/7/07, Robert Hicks [EMAIL PROTECTED] wrote:
snip
I think part of the problem is the 'shift'ing that I was doing. I am
looking into that. Basically I was shift'ing the @log out of existence
after the first pass.
snip
That sounds like a viable candidate for the warning as
On Fri, 2003-12-12 at 15:59, John Fitzgerald wrote:
I need a list set like this:
IDdate
3008 11/1/03
3008 11/1/03
3008 11/1/03
3010 12/1/03
3010 12/1/03
So I need repeating ID's, with the earliest date for
each ID. If the order of the data is preserved, I can
use just those
John Fitzgerald wrote:
Hi,
Hello,
I'm fairly new to Perl, and trying to do a simple
operation on a text file exported from excel.
ID Enrolled Extraneous Columns
300805-Aug-03
300805-Aug-03
300805-Aug-03
300805-Aug-03
300824-Sep-03
300911-Aug-03
John Fitzgerald wrote:
Hi, I'm fairly new to Perl, and trying to do a simple
operation on a text file exported from excel.
ID Enrolled Extraneous Columns
3008 05-Aug-03
3008 05-Aug-03
3008 05-Aug-03
3008 05-Aug-03
3008 24-Sep-03
3009 11-Aug-03
3010 19-Nov-03
3010 11-Jul-03
Thanks for the reply, I don't have date::calc but I
can CPAN it right now.
I need a list set like this:
IDdate
3008 11/1/03
3008 11/1/03
3008 11/1/03
3010 12/1/03
3010 12/1/03
So I need repeating ID's, with the earliest date for
each ID. If the order of the data is preserved, I can
use
John Fitzgerald wrote:
--- Rob Dixon [EMAIL PROTECTED] wrote:
John Fitzgerald wrote:
Hi, I'm fairly new to Perl, and trying to do a
simple
operation on a text file exported from excel.
ID Enrolled Extraneous Columns
3008 05-Aug-03
3008 05-Aug-03
3008
John Fitzgerald wrote:
Hi, I'm fairly new to Perl, and trying to do a simple
operation on a text file exported from excel.
ID Enrolled Extraneous Columns
300805-Aug-03
300805-Aug-03
300805-Aug-03
300805-Aug-03
300824-Sep-03
300911-Aug-03
3010
22 matches
Mail list logo