|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.misc.SplitFile
This program provides a mechanism to easily split a text file into multiple files based on a number of criteria (specific number of files, number of lines per file, or number of bytes per file).
| Field Summary | |
static int |
SPLIT_TYPE_NUM_BYTES
The split type that indicates the file should be split up so that there are a maximum number of bytes per file. |
static int |
SPLIT_TYPE_NUM_FILES
The split type that indicates the file should be split up into a specific number of files. |
static int |
SPLIT_TYPE_NUM_FILES_PRESERVE_ORDER
The split type that indicates the file should be split up into a specific number of files. |
static int |
SPLIT_TYPE_NUM_LINES
The split type that indicates the file should be split up so that there are a maximum number of lines per file. |
| Constructor Summary | |
SplitFile(java.lang.String[] args)
Creates a new instance of this program and coordinates the process of splitting the file. |
|
| Method Summary | |
int |
countLines()
Counts the number of lines in the input file. |
void |
displayUsage()
Prints usage information for this program to standard error. |
static void |
main(java.lang.String[] args)
The main method for this program, which simply invokes the constructor. |
void |
splitByMaxBytes()
Splits the input file into a number of output files based on the number of bytes per file. |
void |
splitByMaxLines()
Splits the input file into a number of output files based on the number of lines per file. |
void |
splitToNumFiles()
Splits the input file into the specified number of output files. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int SPLIT_TYPE_NUM_FILES
public static final int SPLIT_TYPE_NUM_FILES_PRESERVE_ORDER
public static final int SPLIT_TYPE_NUM_LINES
public static final int SPLIT_TYPE_NUM_BYTES
| Constructor Detail |
public SplitFile(java.lang.String[] args)
args - The command line arguments provided to the program.| Method Detail |
public static void main(java.lang.String[] args)
args - The command line arguments provided to the program.
public int countLines()
throws java.io.IOException
java.io.IOException - If a problem occurs while counting the lines in the
file.
public void splitToNumFiles()
throws java.io.IOException
java.io.IOException - If a problem occurs while splitting the file.
public void splitByMaxLines()
throws java.io.IOException
java.io.IOException - If a problem occurs while splitting the file.
public void splitByMaxBytes()
throws java.io.IOException
java.io.IOException - If a problem occurs while splitting the file.public void displayUsage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||