Ask a Question related to PERL Beginners, Design and Development.
-
Mark Weisman #1
Reverse Order?
I read a text file into HTML for viewing through a webpage, fairly
straight forward.
Open (INFILE, "<filename.txt") || die "Error opening
filename.txt.$!,stopped";
@array = <INFILE>;
Close(INFILE);
Foreach my $rec (@array) {
chomp($rec);
($a,$b) = split(/\|/,$rec);
print "<i>$a - $b</i><br>\n";
};
This code simply reads the text file, and populates it to the screen in
the line order from the text file. I need to reverse the order from the
text file to the screen. So that the last entry in the text file appears
at the top of the HTML page? Can anyone help me out? I'm hoping that I
can just do this in the display code, and that I don't have to rewrite
the file writing sequence.
Sincerely in Christ,
Mark
Mark Weisman Guest
-
sw parameters in reverse order
We have several shockwave objects built into our learning management application. These objects use ini files to display user relevant learning... -
Tab Order always greyed out, need to redefine order but can't
I had a check box but then i had to delete it and change it to a text field. now my tab order is all out of whack and I can't seem to set the tab... -
How can I - Reverse Page Order? Delete all odd pages?
I have documents that need to be archived, unfortunately the laser printer makes then curl so I can't scan them as simplex through the ADF. I can get... -
php/mysql query insert values into enters the records in reverse order
I'm loading tab delimited lines from a txt file using php and running a query for each line to enter the data into a mysql database. However the... -
Reverse Page Order
I have a 25 page pdf document that is in the wrong order. What is the best way to reverse this order? Thank you. -
Dan Muey #2
RE: Reverse Order?
Just a litle tip, I think it's not a good idea to use> try
>
> open (INFILE, "<filename.txt") || die "Error opening
> filename.txt.$!,stopped"; @array = <INFILE>; close(INFILE);
> foreach my $rec (reverse(@array)) {
> chomp($rec);
> ($a,$b) = split(/\|/,$rec);
$a and $b variables since Perl uses those for sort() and whatever.
> print "<i>$a - $b</i><br>\n";
> };
>
>
> -----Original Message-----
> From: Mark Weisman [mailto:mark@outlander.us]
> Sent: Tuesday, September 02, 2003 8:53 AM
> To: [email]beginners@perl.org[/email]
> Subject: Reverse Order?
>
>
> I read a text file into HTML for viewing through a webpage,
> fairly straight forward.
>
> Open (INFILE, "<filename.txt") || die "Error opening
> filename.txt.$!,stopped"; @array = <INFILE>; Close(INFILE);
> Foreach my $rec (@array) {
> chomp($rec);
> ($a,$b) = split(/\|/,$rec);
> print "<i>$a - $b</i><br>\n";
> };
>
> This code simply reads the text file, and populates it to the
> screen in the line order from the text file. I need to
> reverse the order from the text file to the screen. So that
> the last entry in the text file appears at the top of the
> HTML page? Can anyone help me out? I'm hoping that I can just
> do this in the display code, and that I don't have to rewrite
> the file writing sequence.
>
> Sincerely in Christ,
> Mark
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
>
>Dan Muey Guest
-
Mark Weisman #3
RE: Reverse Order?
Worked like a charm, big time thanks.
Sincerely in Christ,
Mark-Nathaniel Weisman
President / Owner
Outland Domain Group Consulting
Anchorage / Washington DC / Bellevue
[email]mark@outlander.us[/email]
-----Original Message-----
From: [email]Marcos.Rebelo@eurocopter.com[/email] [mailto:Marcos.Rebelo@eurocopter.com]
Sent: Monday, September 01, 2003 10:58 PM
To: Mark Weisman; [email]beginners@perl.org[/email]
Subject: RE: Reverse Order?
try
open (INFILE, "<filename.txt") || die "Error opening
filename.txt.$!,stopped"; @array = <INFILE>; close(INFILE); foreach my
$rec (reverse(@array)) {
chomp($rec);
($a,$b) = split(/\|/,$rec);
print "<i>$a - $b</i><br>\n";
};
-----Original Message-----
From: Mark Weisman [mailto:mark@outlander.us]
Sent: Tuesday, September 02, 2003 8:53 AM
To: [email]beginners@perl.org[/email]
Subject: Reverse Order?
I read a text file into HTML for viewing through a webpage, fairly
straight forward.
Open (INFILE, "<filename.txt") || die "Error opening
filename.txt.$!,stopped"; @array = <INFILE>; Close(INFILE); Foreach my
$rec (@array) {
chomp($rec);
($a,$b) = split(/\|/,$rec);
print "<i>$a - $b</i><br>\n";
};
This code simply reads the text file, and populates it to the screen in
the line order from the text file. I need to reverse the order from the
text file to the screen. So that the last entry in the text file appears
at the top of the HTML page? Can anyone help me out? I'm hoping that I
can just do this in the display code, and that I don't have to rewrite
the file writing sequence.
Sincerely in Christ,
Mark
Mark Weisman Guest



Reply With Quote

