diff --git a/noinfo/make-prospectingguide.pl b/noinfo/make-prospectingguide.pl new file mode 100755 index 000000000..eda8468ca --- /dev/null +++ b/noinfo/make-prospectingguide.pl @@ -0,0 +1,536 @@ +#!/usr/bin/perl -w +use strict; +use File::Path; +use Getopt::Long; + +# header column never has any info... + +((my $progname = $0) =~ s/^.*(\/|\\)//ig); # basename $0 + +# Parse options +my $no_verbose_progress = 0; +my $usage = 0; +GetOptions('quiet' => \$no_verbose_progress, # be quiet + 'help' => \$usage # help! + ); + +# Print usage +if ($usage) { + usage(); +} + +unless ($ARGV[0]) { + print STDERR "Specify a CSV file name as the program's argument(e.g. CAVETAB2.CSV)\n"; + usage(); +} + +open (CSV, "< $ARGV[0]") or print STDERR "That filename could not be opened. Exiting.\n" and die $!; + +# Start writing prospecting file +open PROS, ">..\/prospecting.htm" or die $!; +print PROS << "END"; + + + +
+ +| ";
+ if ($kat_num) {
+ print PROS "$kat_num";
+ }
+ if ($ents) {
+ print PROS " - $ents";
+ }
+ if ($other_number) {
+ if ($kat_num) {
+ print PROS " "; + } + print PROS " $other_number"; + } + print PROS " | $name";
+ if ($unofficial_name) {
+ if ($name) {
+ print PROS " "; + } + print PROS " ($unofficial_name)"; + } + print PROS " | ";
+ if ($kat_status) {
+ print PROS "$kat_status | "; + } + print PROS "
|---|
"; + } + if ($length) { + print PROS "Length: $length "; + } + if ($depth) { + print PROS "Depth: $depth "; + } + if ($extent) { + print PROS "Extent: $extent "; + } + if ($length or $depth or $extent) { + print PROS "
"; + } + + # Entrance specific bit + + unless ($mult_ents eq "yes") { + # If there is only one entrance, + print PROS "\n\n"; + if ($tag_punkt || $other_punkt || $exact_punkt || $gpspostsa || $gpspresa || $easting || $northing || $altitude || $fix_type || $desc_other_punkt && !$ent_name) { # basically, if do_ent is going to do anything, print "Entrance:" + print PROS "Entrance: "; + } + # Process the location data for the entrance + do_ent($tag_punkt,$other_punkt,$exact_punkt,$gpspostsa,$gpspresa,$easting,$northing,$altitude,$ent_name,$fix_type,$desc_other_punkt); + print PROS "
" + } else { + # If there are multiple entrances + multi_ents($file, $kat_num, $other_number, $other_number_no_brackets, $toroot); + } + + # Cave general bit + if ($location) { + print PROS "\n\nLocation: $location
"; + } + if ($bearings) { + print PROS "\n\nBearings: $bearings
"; + } + if ($approach) { + print PROS "\n\nApproach: $approach
"; + } + if ($map) { + print PROS "\n\nMap: $map
"; + } + if ($ent_desc) { + print PROS "\n\nEntrance Description: $ent_desc
"; + } + if ($ent_photo) { + print PROS "\n\nEntrance Photo: $ent_photo
"; + } + if ($marking and $marking ne "\r" and $marking ne "\r\n" and $marking ne "\n") { # bodgelicious. + print PROS "\n\nMarking: $marking
"; + } + if ($references) { + print PROS "\n\nReferences: $references
"; + } + if ($u_description) { + print PROS "\n\nUnderground Description: $u_description
"; + } + if ($equipment) { + print PROS "\n\nEquipment: $equipment
"; + } + if ($qmlist) { + print PROS "\n\nQM list: $qmlist
"; + } + if ($u_drawn_survey) { + print PROS "\n\nSurvey: $u_drawn_survey
"; + } + if ($notes) { + print PROS "\n\nNotes: $notes
"; + } + if ($explorers) { + print PROS "\n\nExplorers: $explorers
"; + } + if ($katstatus) { + print PROS "\n\nKataster Status: $katstatus
"; + } + if ($u_centre_line) { + print PROS "\n\nCentre Line: $u_centre_line
"; + } + if ($survex_file) { + print PROS "\n\nSurvex file: $survex_file
"; + } + + if ($footer) { + print PROS "\n\n$footer
"; + } + +# print PROS "\n\n\n