]> git.mxchange.org Git - flightgear.git/blob - DemInfo/gather-dem-info.pl
Rearrange a bit of code ...
[flightgear.git] / DemInfo / gather-dem-info.pl
1 #!/usr/bin/perl
2
3 #---------------------------------------------------------------------------
4 # script to gather DEM position info so we can associate a file name with a
5 # position.
6 #
7 # Written by Curtis Olson, started June 1998.
8 #
9 # Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
10 #
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #
25 # $Id$
26 # (Log is kept at end of this file)
27 #---------------------------------------------------------------------------
28
29
30 if ( $#ARGV < 0 ) {
31     die "Usage: $0 search_dir ... \n";
32 }
33
34 while ( $dir = shift(@ARGV) ) {
35     # print "processing $dir\n";
36
37     @allfiles = `find $dir -print`;
38
39     foreach $file (@allfiles) {
40         chop($file);
41         # print "trying $file\n";
42         if ( -f $file ) {
43             # print "really trying $file\n";
44             open ( INFO, "./deminfo $file |" );
45             while ( <INFO> ) {
46                 if ( m/Results = / ) {
47                     $_ =~ s/Results = //;
48                     print $_;
49                 }
50             }
51             close(INFO);
52         }
53     }
54 }
55
56
57 #---------------------------------------------------------------------------
58 # $Log$
59 # Revision 1.1  1998/06/04 19:18:06  curt
60 # Initial revision.
61 #