com.rapidminer.example.table
Class RapidMinerLineReader
java.lang.Object
com.rapidminer.example.table.RapidMinerLineReader
public class RapidMinerLineReader
- extends java.lang.Object
A simple line converter for reading data from BufferedReaders. Each line is
separated into columns using a pattern matcher based on regular expressions.
In addition, comments might be also defined. Everything after a comment
character is completely ignored.
Quotes might also be used. If a columns starts with a quote (") the end
of the quoted region is searched and the corresponding columns build a new
column which replaces the old ones. Quoting is added for compatibility
reasons only. Since parsing is slower if quoting is used, quotes should not
be used at all. If possible please use and define a column separator which is
not part of your data.
- Author:
- Ingo Mierswa
|
Constructor Summary |
RapidMinerLineReader(java.lang.String separatorsRegExpr,
char[] commentChars,
boolean useQuotes,
char quoteChar,
char escapeChar,
boolean trimLines,
boolean skipErrorLines)
Indicates if quoting (") can be used to form. |
|
Method Summary |
java.lang.String[] |
readLine(java.io.BufferedReader in,
int expectedNumberOfColumns)
Ignores comment and empty lines and returns the first line not starting
with a comment. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RapidMinerLineReader
public RapidMinerLineReader(java.lang.String separatorsRegExpr,
char[] commentChars,
boolean useQuotes,
char quoteChar,
char escapeChar,
boolean trimLines,
boolean skipErrorLines)
- Indicates if quoting (") can be used to form.
readLine
public java.lang.String[] readLine(java.io.BufferedReader in,
int expectedNumberOfColumns)
throws java.io.IOException
- Ignores comment and empty lines and returns the first line not starting
with a comment. Returns null if no such line exists. Throws an
IOException if the line does not provide the given expected number of
columns. This check will not be performed if the given parameter value
is -1.
- Throws:
java.io.IOException
Copyright © 2001-2009 by Rapid-I