On Fri, Jan 21, 2011 at 5:35 PM, jet speed wrote:
>
>
> On Fri, Jan 21, 2011 at 5:18 PM, Jim Gibson wrote:
>
>> On 1/21/11 Fri Jan 21, 2011 8:43 AM, "jet speed"
>> scribbled:
>>
>> > Hi All,
>> > I need some help with the blow.
>> >
>> > I have a an input file with the below data
>> >
>> > 18
On 1/21/11 Fri Jan 21, 2011 8:43 AM, "jet speed"
scribbled:
> Hi All,
> I need some help with the blow.
>
> I have a an input file with the below data
>
> 1835
> 1836
> 1837
> 1838
> 1839
> 183A
> 183B
> 183C
> 183D
>
>
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> my $filename;
> $f
On Fri, Jan 21, 2011 at 5:57 PM, Rob Coops wrote:
>
>
> On Fri, Jan 21, 2011 at 5:43 PM, jet speed wrote:
>
>> Hi All,
>> I need some help with the blow.
>>
>> I have a an input file with the below data
>>
>> 1835
>> 1836
>> 1837
>> 1838
>> 1839
>> 183A
>> 183B
>> 183C
>> 183D
>>
>>
>> #!/usr/bin
On Fri, Jan 21, 2011 at 5:43 PM, jet speed wrote:
> Hi All,
> I need some help with the blow.
>
> I have a an input file with the below data
>
> 1835
> 1836
> 1837
> 1838
> 1839
> 183A
> 183B
> 183C
> 183D
>
>
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> my $filename;
> $filename = "input.
sorry!
$line_count at the end of the while block should be $line_count++
On Fri, Jan 21, 2011 at 10:54 AM, jbiskofski wrote:
> my $line_count = 1;
> my @captured_elements;
>
> open(FILE, $filename) || die 'cant open file';
> while () {
> chomp;
> push(@captured_elements, $_) unless ($li
my $line_count = 1;
my @captured_elements;
open(FILE, $filename) || die 'cant open file';
while () {
chomp;
push(@captured_elements, $_) unless ($line_count % 4);
$line_count;
}
close(FILE);
---
% is the modulus operator, it returns the remainder of a division so ... 6 %
4 = 2, 7
Hi All,
I need some help with the blow.
I have a an input file with the below data
1835
1836
1837
1838
1839
183A
183B
183C
183D
#!/usr/bin/perl
use strict;
use warnings;
my $filename;
$filename = "input.txt" ;
open (FILE, "< $filename" ) or die "Could not open $filename: $!";
while () {
chomp