Anabat Data File Utility

A library for working with data files downloaded from an Anabat bat detector.

Example Usage


def result = [:]

new AnabatDataFileset('datadir').each { AnabatDataFile anabat, File file ->
    anabat.species.each { spc ->
        if( !result[spc] )
            result[spc] = 1
result.each { speciesName, count ->
    println "$speciesName : $count"

You can also alter most of the fields within the data files, in bulk. The below example sets the Location field for all anabat data files below 'datadir' to 'Location Name', but only if they don't already have a location.


def result = [:]

new AnabatDataFileset('datadir').eachWithSave { AnabatDataFile anabat, File file ->
    if( !anabat.location ) {
        anabat.location = 'Location Name'

See the groovydoc for full details of the available methods.


The build system uses the Gradle wrapper. Therefore the only requirement is Java 6 or later.


will build the library as a jar.


AnabatDataFile is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please see the copy of the licence, included in this directory as COPYING, for details.

The jar built with this project includes the joda-time library, which is licensed under the Apache Licence Version 2.

Bugs, Wishlist

Data file format supports position specified as UTM coordinates as well as lat/long, but this library understands only lat/long.

Feel free to fork and send pull requests! Home page on BitBucket at