edu.northwestern.at.morphadorner.tools.mergetextfiles

## Class MergeTextFiles

- java.lang.Object
- - edu.northwestern.at.morphadorner.tools.mergetextfiles.MergeTextFiles

-     public class MergeTextFiles
      extends java.lang.Object

  Merge text files.

  Usage:

  java edu.northwestern.at.morphadorner.tools.mergetextfiles.MergeTextFiles output.txt input.txt input2.txt ...
  output.txt -- output merged text file.
  input*.txt -- input text files to be merged.

  The output file is a utf-8 text file containing the merged content of the input files.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static int` | `currentFileNumber` Current document.
    `protected static int` | `filesToProcess` Number of documents to process.
    `protected static int` | `INITPARAMS` # params before input file specs.
    `protected static java.lang.String` | `mergedOutputFileName` Output file name.
    `protected static int` | `totalLines` Total lines merged.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MergeTextFiles()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static boolean` | `initialize(java.lang.String[] args)` Initialize.
    `static void` | `main(java.lang.String[] args)` Main program.
    `protected static int` | `processFiles(java.lang.String[] args)` Process files.
    `protected static void` | `processOneFile(java.lang.String inputFileName, java.lang.String outputFileName)` Process one file.
    `protected static void` | `terminate(int filesProcessed, long processingTime)` Terminate.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INITPARAMS

          protected static final int INITPARAMS

      # params before input file specs.
      See Also:
        Constant Field Values

    - #### filesToProcess

          protected static int filesToProcess

      Number of documents to process.

    - #### currentFileNumber

          protected static int currentFileNumber

      Current document.

    - #### totalLines

          protected static int totalLines

      Total lines merged.

    - #### mergedOutputFileName

          protected static java.lang.String mergedOutputFileName

      Output file name.

  - ### Constructor Detail

    - #### MergeTextFiles

          public MergeTextFiles()

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)

      Main program.
      Parameters:
        `args` - Program parameters.

    - #### initialize

          protected static boolean initialize(java.lang.String[] args)
                                       throws java.lang.Exception

      Initialize.
      Throws:
        `java.lang.Exception`

    - #### processOneFile

          protected static void processOneFile(java.lang.String inputFileName,
                            java.lang.String outputFileName)

      Process one file.
      Parameters:
        `inputFileName` - Input file name.
        `outputFileName` - Output file name.

    - #### processFiles

          protected static int processFiles(java.lang.String[] args)
                                     throws java.lang.Exception

      Process files.
      Throws:
        `java.lang.Exception`

    - #### terminate

          protected static void terminate(int filesProcessed,
                       long processingTime)

      Terminate.
      Parameters:
        `filesProcessed` - Number of files processed.
        `processingTime` - Processing time in seconds.