#!/usr/bin/perl
# Make an HTML chceklist for NEAR/MSI data
#
# 16 March 2006, acr
#
#===========================================================================
opendir (VOL,"/n/pdsraid02/volume") || die "Could not open volume/ root ($!)";
$cw = "15%"; # Cell width
# Start the HTML page:
printf "\n
\nChecklist\n";
printf "\n";
printf "\n";
foreach $file (sort readdir(VOL))
{ next if ($file !~ /^ni.*_3/);
$top = $file;
$rowcount = 0;
undef @sublist;
opendir (TOP,"/n/pdsraid02/volume/$top") ||
die "Could not open $top for reading ($!)";
foreach $subdir (sort readdir(TOP))
{ next if ($subdir !~ /^ni/);
$sublist[$rowcount] = $subdir;
$rowcount++;
}
closedir(TOP);
# Print out the first table row:
printf "| $top | ";
printf "$sublist[$0] | ";
for ($i=0; $i<5; $i++) { printf " | "; }
printf "
\n";
# Print the rest of the rows:
for ($i=1; $i<$rowcount; $i++)
{ printf "| $sublist[$i] | ";
for ($j=0; $j<5; $j++) { printf " | "; }
printf "
\n";
}
# Next volume
}
closedir(VOL);
# Finish the HTML:
printf "
\n\n\n";
# Done.