Explore BrainMass

Explore BrainMass

    Converting CSV File Into Table Using Perl

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Create a Perl script to parse through a comma-separated values (CSV) file and display each record in a tabular format. As an example, take:

    John, Dean, 23
    Malcolm, Ranger, 49
    Jennifer, Randolf, 49

    And then display it in a table such as: (see attachment)

    © BrainMass Inc. brainmass.com October 9, 2019, 10:15 pm ad1c9bdddf


    Solution Preview

    This solution required creating a perl script that would read a file
    of comma separated values and output those values as an html table.

    In order to read data from a file the file first has to be opened.
    This is done in perl using the open() function:

    open(FP,"file.csv") || die "Couldn't open the file: $!n";

    This also includes ...

    Solution Summary

    Script that performs outlined functionality in attachment.