FindAndExtractHeaders Method

Finds HDF files in a directory, extracts their headers, and saves the headers to text files.

Class:HDF
Intended use:Recommended for external callers
COM:Exposed as the FindAndExtractHeaders method of COM class GeoEco.HDF
ArcGIS:Exposed as the Find HDFs and Extract Headers geoprocessing tool
Method type:Classmethod

Usage

updatedOutputDirectory = HDF.FindAndExtractHeaders(inputDirectory, outputDirectory[, wildcard[, searchTree[, minSize[, maxSize[, minDateCreated[, maxDateCreated[, minDateModified[, maxDateModified[, outputFilePythonExpression[, modulesToImport[, skipExisting[, overwriteExisting]]]]]]]]]]]])

Arguments

inputDirectory
Python type:unicode
Minimum length:1
Maximum length:255
Must exist:Yes

Directory to search.

outputDirectory
Python type:unicode
Minimum length:1
Maximum length:255
Must exist:No

Directory to receive the text files.

wildcard
Python type:unicode
Default value:u'*'
Minimum length:1

UNIX-style "glob" wildcard expression specifying the pathnames to find.

The glob syntax supports the following patterns:

seq is one or more characters, such as abc. You may specify character ranges using a dash. For example, a-z0-9 specifies all of the characters in the English alphabet and the decimal digits 0 through 9.

You may specify subdirectories in the glob expression. For example, the expression cruise*/sst* will find all paths beginning with sst that are contained in directories beginning with cruise.

The operating system determines whether / or \ is used as the directory separator. On Windows, both will work. On most flavors of UNIX, / must be used.

The operating system determines if matching is case sensitive. On Windows, matching is case-insensitive. On most flavors of UNIX, matching is case-sensitive.

searchTree
Python type:bool
Default value:False

If True, subdirectories will be searched.

minSize
Python type:int or None
Default value:None
Minimum value:0

Minimum size, in bytes, of files to find. If provided, only files that are this size or larger will be found.

maxSize
Python type:int or None
Default value:None
Minimum value:0

Maximum size, in bytes, of files to find. If provided, only files that are this size or smaller will be found.

minDateCreated
Python type:datetime.datetime or None
Default value:None

Minimum creation date, in the local time zone, of the files to find, as reported by the operating system. If provided, only files that were created on or after this date will be found. You may provide a date with or without a time. If you do not provide a time, it is assumed to be midnight.

maxDateCreated
Python type:datetime.datetime or None
Default value:None

Maximum creation date, in the local time zone, of the files to find, as reported by the operating system. If provided, only files that were created on or before this date will be found. You may provide a date with or without a time. If you do not provide a time, it is assumed to be midnight.

minDateModified
Python type:datetime.datetime or None
Default value:None

Minimum modification date, in the local time zone, of the files to find, as reported by the operating system. If provided, only files that were modified on or after this date will be found. You may provide a date with or without a time. If you do not provide a time, it is assumed to be midnight.

maxDateModified
Python type:datetime.datetime or None
Default value:None

Maximum modification date, in the local time zone, of the files to find, as reported by the operating system. If provided, only files that were modified on or before this date will be found. You may provide a date with or without a time. If you do not provide a time, it is assumed to be midnight.

outputFilePythonExpression
Python type:unicode or None
Default value:u'os.path.join(outputDirectory, os.path.splitext(inputFile)[0][len(directoryToSearch)+1:] + u'.txt')'
Minimum length:1

Python expression used to calculate the absolute path of an output file. The expression may be any Python statement appropriate for passing to the eval function and must return a Unicode string. The expression may reference the following variables:

The default expression:

os.path.join(outputDirectory, os.path.splitext(inputFile)[0][len(directoryToSearch)+1:] + u'.txt')

stores the output file in the output directory at the same relative location that the input file appears in the directory to search. The output file name is the same as the input file name but with a .txt extension.

For more information on Python syntax, please see the Python documentation.

modulesToImport
Python type:list of unicode, or None
Default value:[u'os.path']
Minimum length:0

Python modules to import prior to evaluating the expression. If you need to access Python functions or classes that are provided by a module rather than being built-in to the interpreter, list the module here. For example, to be able to use the datetime class in your expression, list the datetime module here. In your expression, you must refer to the class using its fully-qualified name, datetime.datetime.

skipExisting
Python type:bool
Default value:False

If True, processing will be skipped for text files that already exist.

overwriteExisting
Python type:bool
Default value:False

If True and skipExisting is False, existing text files will be overwritten.

Returns

updatedOutputDirectory
Python type:unicode
Minimum length:1
Maximum length:255
Must exist:No

Directory to receive the text files.