I wrote a perl script using Tie :: Handle :: CSV to process the dataset in the csv file and printed only what I needed into a new csv file. Right now I am printing a title bar with all field names, just using hardcoding like this:
print '"TERM", "STUDENT ID", "NAME", ..."'."\n";
I suspect this is a dumb way to do this, but I don't know how to access the header from the Tie :: Handle :: CSV object. It is created in such a way
my $fh = Tie::Handle::CSV->new($file,header=> 1);
and access to data is the same
$line -> {'CATALOG_NBR'}
I know enough to know that this is a hash link, but not enough to know how to print the header using this, and not hard code it. Obviously, βtheyβ usually change the exact column names and arrange them right after I get the script working with each term again.
Thanks for the help! Ja
perl
Jason
source share