#!/usr/local/bin/perl # gauqastro1.pl # by Apollia of Astroblahhh.Com - http://astroblahhh.com/ Completed July 19, 2004. # # Public domain. # INFORMATION FOR THIS PROGRAM # # This is a script for converting the lines of data in the Gauquelin data files # at http://cura.free.fr/gauq/17archg.html to Astrolog 5.40 command lines. This # script only works for the following files: # #--> Sports Champions (Champions de Sport) = volume 1 #--> Men of Science (Hommes de Science) = volume 2 #--> Military Men (Hommes de Guerre) = volume 3 #--> Musicians (Musiciens) = volume 4 (1) #--> Painters (Peintres) = volume 4 (2) #--> Actors (Acteurs) = volume 5 (1) #--> Politicians (Hommes Politiques) = volume 5 (2) #--> Writers & Journalists (Écrivains et Journalistes) = volume 6 # # Another script will be needed to process the other Gauquelin data files. # # To use this script, you will need to make a text file called "astroinputfile.txt" # in the same directory as the script, and put some of the Gauquelin data from # the above files at http://cura.free.fr/gauq/17archg.html in the file. The # script doesn't need any arguments to run; running it by typing something like # "perl gauqastro1.pl" should suffice. The results will be output to a file # called "astrooutputfile.txt". # # You may not have to use this script at all, however, unless you want to # modify it to do something different, since there should already be some text # files of the Gauquelin data converted to Astrolog 5.40 command lines using # this script, at http;//astroblahhh.com/ open(INPUTFILE,"astroinputfile.txt"); open(RESULTS, ">astrooutputfile.txt"); my $curline; while ($curline = ) { $usedept="false"; $persontype =substr($curline,0,1); $numbr =substr($curline,1,4); $country =substr($curline,5,1); $day =substr($curline,6,2); $month =substr($curline,8,2); $year =substr($curline,10,4); $hour =substr($curline,14,2); $min =substr($curline,16,2); $sec =substr($curline,18,2); $zone =substr($curline,20,2); $latdeg =substr($curline,22,2); $lat =substr($curline,24,1); $latmin =substr($curline,25,2); $londeg =substr($curline,27,2); $lon =substr($curline,29,1); $lonmin =substr($curline,30,2); $place =substr($curline,32,15); $dept =substr($curline,47,9); $min=MakeIntoTwoChars($min); $sec=MakeIntoTwoChars($sec); $latmin=MakeIntoTwoChars($latmin); $lonmin=MakeIntoTwoChars($lonmin); print RESULTS "-qa $month $day $year $hour:$min:$sec "; if ($zone eq " 0") { print RESULTS "GMT "; } elsif ($zone eq "-1") { print RESULTS "CET "; }; print RESULTS "$londeg:$lonmin$lon $latdeg:$latmin$lat\n"; $numbr=~s/ //g; #strips out empty spaces #The program won't distinguish correctly between the M for Military Man in #Vol. 3 and the M for Musician in Vol. 4A, or the P for Painter in Vol. 4B # and the P for Politician in Vol. 5B. if ($persontype eq "C") { $persontype="Sports champion"; } elsif ($persontype eq "S") { $persontype="Scientist"; } elsif ($persontype eq "M") { $persontype="Military man"; } elsif ($persontype eq "P") { $persontype="Painter"; } elsif ($persontype eq "M") { $persontype="Musician"; } elsif ($persontype eq "A") { $persontype="Actor"; } elsif ($persontype eq "P") { $persontype="Politician"; } elsif ($persontype eq "W") { $persontype="Writer"; } elsif ($persontype eq "J") { $persontype="Journalist"; } if ($country eq "F") { $country="France"; $usedept="true"; } elsif ($country eq "I") { $country="Italy"; } elsif ($country eq "G") { $country="Germany"; } elsif ($country eq "B") { $country="Belgium"; } elsif ($country eq "N") { $country="Netherlands"; }; $place=~s/ //g; #strips out empty spaces, including, #slightly unfortunately, the ones between words $place=~tr/A-Z/a-z/; #makes it all lowercase substr($place,0,1)=~tr/a-z/A-Z/; #capitalizes first letter print RESULTS "Data #$numbr\n$persontype born in $place, $country, "; if ($usedept eq "true") { print RESULTS "Departement $dept"; } else { print RESULTS $dept; }; print RESULTS "\n\n"; } print "Done; results should be in astrooutputfile.txt.\n"; sub MakeIntoTwoChars { $firstchar=substr($_[0],0,1); if ($firstchar==" ") { $secondchar=substr($_[0],1,1); $newstr="0" . $secondchar; return $newstr; #substr($min,0,1)=$secondchar; } return $_[0]; }