|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jmatchparser.util.csv.AbstractCSVReader
net.sf.jmatchparser.util.csv.FixedWidthCSVReader
public class FixedWidthCSVReader
Class to read data from a fixed width CSV (Comma Separated Value) file, where every column has a fixed width and may optionally additionally delimited by separator characters.
Constructor Summary | |
---|---|
FixedWidthCSVReader(BufferedReader br,
FixedWidthColumn... columns)
Create a new FixedWidthCSVReader that reads from the given
buffered reader using the given columns and no separators. |
|
FixedWidthCSVReader(BufferedReader br,
int... widths)
Create a new FixedWidthCSVReader that reads from the given
buffered reader using left-aligned space-padded columns only and no
separators. |
|
FixedWidthCSVReader(BufferedReader br,
String... columnSpecs)
Create a new FixedWidthCSVReader that reads from the given
buffered reader using columns parsed from the given column specs and no
separators. |
|
FixedWidthCSVReader(BufferedReader br,
String prefix,
String separator,
String suffix,
FixedWidthColumn... columns)
Create a new FixedWidthCSVReader that reads from the given
buffered reader using the given columns and separators. |
|
FixedWidthCSVReader(InputStream in,
String charsetName,
FixedWidthColumn... columns)
Create a new FixedWidthCSVReader that reads from the given stream
using the given columns and no separators. |
|
FixedWidthCSVReader(InputStream in,
String charsetName,
int... widths)
Create a new FixedWidthCSVReader that reads from the given stream
using left-aligned space-padded columns only and no separators. |
|
FixedWidthCSVReader(InputStream in,
String charsetName,
String... columnSpecs)
Create a new FixedWidthCSVReader that reads from the given stream
using columns parsed from the given column specs and no separators. |
|
FixedWidthCSVReader(InputStream in,
String charsetName,
String prefix,
String separator,
String suffix,
FixedWidthColumn... columns)
Create a new FixedWidthCSVReader that reads from the given stream
using the given columns and separators. |
|
FixedWidthCSVReader(Reader r,
FixedWidthColumn... columns)
Create a new FixedWidthCSVReader that reads from the given reader
using the given columns and no separators. |
|
FixedWidthCSVReader(Reader r,
int... widths)
Create a new FixedWidthCSVReader that reads from the given reader
using left-aligned space-padded columns only and no separators. |
|
FixedWidthCSVReader(Reader r,
String... columnSpecs)
Create a new FixedWidthCSVReader that reads from the given reader
using columns parsed from the given column specs and no separators. |
|
FixedWidthCSVReader(Reader r,
String prefix,
String separator,
String suffix,
FixedWidthColumn... columns)
Create a new FixedWidthCSVReader that reads from the given reader
using the given columns and separators. |
Method Summary | |
---|---|
void |
close()
Close this reader. |
String[] |
read()
Read a line from the fixed width CSV file. |
void |
setStripComments(boolean stripComments)
Set whether comments (lines starting with # or empty lines) should be stripped. |
Methods inherited from class net.sf.jmatchparser.util.csv.AbstractCSVReader |
---|
read, read, writeTo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FixedWidthCSVReader(BufferedReader br, int... widths)
FixedWidthCSVReader
that reads from the given
buffered reader using left-aligned space-padded columns only and no
separators.
br
- The buffered reader to read fromwidths
- The width of each columnpublic FixedWidthCSVReader(BufferedReader br, String... columnSpecs) throws IOException
FixedWidthCSVReader
that reads from the given
buffered reader using columns parsed from the given column specs and no
separators.
br
- The buffered reader to read fromcolumnSpecs
- The format specification of each column
IOException
public FixedWidthCSVReader(BufferedReader br, FixedWidthColumn... columns)
FixedWidthCSVReader
that reads from the given
buffered reader using the given columns and no separators.
br
- The buffered reader to read fromcolumns
- The format of each columnpublic FixedWidthCSVReader(BufferedReader br, String prefix, String separator, String suffix, FixedWidthColumn... columns)
FixedWidthCSVReader
that reads from the given
buffered reader using the given columns and separators.
br
- The buffered reader to read fromprefix
- The prefix to add to each lineseparator
- The separator to add between each fieldsuffix
- The suffix to add to each linecolumns
- The format of each columnpublic FixedWidthCSVReader(Reader r, int... widths)
FixedWidthCSVReader
that reads from the given reader
using left-aligned space-padded columns only and no separators.
r
- The reader to read fromwidths
- The width of each columnpublic FixedWidthCSVReader(Reader r, String... columnSpecs) throws IOException
FixedWidthCSVReader
that reads from the given reader
using columns parsed from the given column specs and no separators.
r
- The reader to read fromcolumnSpecs
- The format specification of each column
IOException
public FixedWidthCSVReader(Reader r, FixedWidthColumn... columns)
FixedWidthCSVReader
that reads from the given reader
using the given columns and no separators.
r
- The reader to read fromcolumns
- The format of each columnpublic FixedWidthCSVReader(Reader r, String prefix, String separator, String suffix, FixedWidthColumn... columns)
FixedWidthCSVReader
that reads from the given reader
using the given columns and separators.
r
- The reader to read fromprefix
- The prefix to add to each lineseparator
- The separator to add between each fieldsuffix
- The suffix to add to each linecolumns
- The format of each columnpublic FixedWidthCSVReader(InputStream in, String charsetName, int... widths) throws UnsupportedEncodingException
FixedWidthCSVReader
that reads from the given stream
using left-aligned space-padded columns only and no separators.
in
- The input stream to read fromcharsetName
- Name of the charset to be usedwidths
- The width of each column
UnsupportedEncodingException
public FixedWidthCSVReader(InputStream in, String charsetName, String... columnSpecs) throws IOException
FixedWidthCSVReader
that reads from the given stream
using columns parsed from the given column specs and no separators.
in
- The input stream to read fromcharsetName
- Name of the charset to be usedcolumnSpecs
- The format specification of each column
IOException
public FixedWidthCSVReader(InputStream in, String charsetName, FixedWidthColumn... columns) throws UnsupportedEncodingException
FixedWidthCSVReader
that reads from the given stream
using the given columns and no separators.
in
- The input stream to read fromcharsetName
- Name of the charset to be usedcolumns
- The format of each column
UnsupportedEncodingException
public FixedWidthCSVReader(InputStream in, String charsetName, String prefix, String separator, String suffix, FixedWidthColumn... columns) throws UnsupportedEncodingException
FixedWidthCSVReader
that reads from the given stream
using the given columns and separators.
in
- The input stream to read fromcharsetName
- Name of the charset to be usedprefix
- The prefix to add to each lineseparator
- The separator to add between each fieldsuffix
- The suffix to add to each linecolumns
- The format of each column
UnsupportedEncodingException
Method Detail |
---|
public void close() throws IOException
AbstractCSVReader
close
in class AbstractCSVReader
IOException
public void setStripComments(boolean stripComments)
public String[] read() throws IOException
read
in class AbstractCSVReader
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |