org.mbari.oasis
Class OasisFileCoallator

java.lang.Object
  extended byorg.mbari.oasis.OasisFileCoallator

public class OasisFileCoallator
extends java.lang.Object

Combine files created by Bob Herlein's extract program into a single data file. This version replaces CoallateOasisFiles and can be called as a static method. This class is designed to read a directory contianing files using 'yyddd' or 'yyyyddd' naming schemes and combine them into a single file. It grabs the header of the first file in the sequence and adds it to the output file. The file created with this should contain identical data as the source files with the exception that a column of years is added as the last column of the data file.

Version:
1.2.1, 19 Jul 1999
Author:
Brian Schlining

Method Summary
static void coallate(java.io.File out)
          Combine files created by extract.
static void coallate(java.io.File outFile, java.io.File inPath)
          Combine files created by extract.
static void coallate(java.lang.String outfile)
          Combine files created by extract.
static void coallate(java.lang.String outfile, java.lang.String inFilepath)
          Combine files created by extract.
static int getYear(java.lang.String file)
          Extract the year from filenames of types 'yyddd' or 'yyyydd'.
static void main(java.lang.String[] args)
          Allows the user to call this class from the command line Type 'java org.mbari.oasis.OasisFileCoallator' for help.
static java.lang.String[] sortFiles(java.text.Collator collator, java.lang.String[] strArray)
          Sorts the array of filename by name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

coallate

public static final void coallate(java.io.File outFile,
                                  java.io.File inPath)
                           throws java.io.IOException
Combine files created by extract. An additional column is added to the end and contains the year, which is parsed from the file name.

Parameters:
inPath - The location of the data files to be combined.
Throws:
java.io.IOException

coallate

public static final void coallate(java.io.File out)
                           throws java.io.IOException
Combine files created by extract. An additional column is added to the end and contains the year, which is parsed from the file name. This method assumes the files ae located in the current user directory

Throws:
java.io.IOException

coallate

public static final void coallate(java.lang.String outfile)
                           throws java.io.IOException
Combine files created by extract. An additional column is added to the end and contains the year, which is parsed from the file name. This method assumes the files ae located in the current user directory

Parameters:
outfile - The file to be created
Throws:
java.io.IOException

coallate

public static final void coallate(java.lang.String outfile,
                                  java.lang.String inFilepath)
                           throws java.io.IOException
Combine files created by extract. An additional column is added to the end and contains the year, which is parsed from the file name.

Parameters:
outfile - The file to be created
Throws:
java.io.IOException

getYear

public static int getYear(java.lang.String file)
Extract the year from filenames of types 'yyddd' or 'yyyydd'.

Parameters:
file - The name of the file
Returns:
The year represented in the file name

sortFiles

public static java.lang.String[] sortFiles(java.text.Collator collator,
                                           java.lang.String[] strArray)
Sorts the array of filename by name


main

public static void main(java.lang.String[] args)
Allows the user to call this class from the command line Type 'java org.mbari.oasis.OasisFileCoallator' for help.