Dynadot Premium User Auctions, September 8 to 16. Great domains with first bid credit.

Perl Scripters - Please Help Me!!

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch

totalservers

Established Member
Impact
0
Are there any genius perl scripters out there?

If there are can you give me some help.....I have no idea how to create perl scripts

My task is as follows:

I need to create a script that will read a text file line by line and print the data into a HTML page and format in appropriate tables.

The script must read each line and store it in a suitable data contruct. The file consist of line of comments beginning with # and lines of data. A valid data line consists of 6 space delimited fields in the following order:

Surname (case insensitive)
Forename (case insensitive)
Subject (case insensitive)
Mark1 (integer between 0 - 100)
Mark2 (integer between 0 - 100)
Mark3 (integer between 0 - 100)

For example a data line would read as follows:
Yates Ian,Bob Science 75 54 45

In other words how do i parse the data from the text file to a properly formatted HTML pages with tables?

Any help will be appreciated!!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
to me looks like ud need something similar to phps explode or something like that
 
0
•••
Hey just noticed this post. I don't know if you've figured it out yet or not, but you can use a foreach loop and split in Perl http://www.perldoc.com/perl5.8.0/pod/func/split.html to loop through the text file and split the strings into separate variables and then display them. It would make it a whole lot easier if your text file only had one delimiter and didn't contain any other content besides the delimited data. :D

Here's a little snippet you may be able to use that reads a space delimited text file and then displays html output for each line which is what I think you want to do.

Code:
#!/usr/bin/perl

    $file= "file.txt";
    open(FILE, "$file") || die "Couldn't open file: $file: $! n";
    my @list = <FILE>;
    close (FILE);

    print "Content-type: text/htmlnn";
    print "<html>n";
    print "<body>n";

    foreach my $var (@list) {
    chop($var);
    ($one,$two,$three,$four,$five,$six)=split(/ /, $var);


my $results  = <<__W__D__T__;

$one $two $three $four $five $six<br>

__W__D__T__

print $results;
    }
print "</body>n";
print "</html>n";
 
0
•••
Please could someone have a look at the file attached within the zip file and run the .pe file as a command line thru linux:

perl -w assig1.pe 3a8.txt 6a1.txt

There are errors occuring - if anyone can help me debug it i will be grateful....
 
0
•••
i have sorted out the error that was occuring - but now the script does not read the txt file or create and write to the html file....
 
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
URLs.com
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back