public class TextFileInputUtils extends Object
Constructor and Description |
---|
TextFileInputUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
checkPattern(String text,
String regex)
Finds a pattern within a String returning the occurrences number
|
static Object[] |
convertLineToRow(LogChannelInterface log,
TextFileLine textFileLine,
TextFileInputMeta info,
Object[] passThruFields,
int nrPassThruFields,
RowMetaInterface outputRowMeta,
RowMetaInterface convertRowMeta,
String fname,
long rowNr,
String delimiter,
String enclosure,
String escapeCharacter,
FileErrorHandler errorHandler,
BaseFileInputAdditionalField additionalOutputFields,
String shortFilename,
String path,
boolean hidden,
Date modificationDateTime,
String uri,
String rooturi,
String extension,
Long size) |
static Object[] |
convertLineToRow(LogChannelInterface log,
TextFileLine textFileLine,
TextFileInputMeta info,
Object[] passThruFields,
int nrPassThruFields,
RowMetaInterface outputRowMeta,
RowMetaInterface convertRowMeta,
String fname,
long rowNr,
String delimiter,
String enclosure,
String escapeCharacter,
FileErrorHandler errorHandler,
BaseFileInputAdditionalField additionalOutputFields,
String shortFilename,
String path,
boolean hidden,
Date modificationDateTime,
String uri,
String rooturi,
String extension,
Long size,
boolean failOnParseError) |
static String[] |
convertLineToStrings(LogChannelInterface log,
String line,
TextFileInputMeta inf,
String delimiter,
String enclosure,
String escapeCharacters) |
static String |
getLine(LogChannelInterface log,
InputStreamReader reader,
EncodingType encodingType,
int formatNr,
StringBuilder line) |
static String |
getLine(LogChannelInterface log,
InputStreamReader reader,
EncodingType encodingType,
int fileFormatType,
StringBuilder line,
String regex) |
static TextFileLine |
getLine(LogChannelInterface log,
InputStreamReader reader,
EncodingType encodingType,
int fileFormatType,
StringBuilder line,
String regex,
long lineNumberInFile)
Returns in the first position a line; ;
on the second position how many lines from file were read to get a full line
|
static String |
getLine(LogChannelInterface log,
InputStreamReader reader,
int formatNr,
StringBuilder line) |
static String[] |
guessStringsFromLine(VariableSpace space,
LogChannelInterface log,
String line,
TextFileInputMeta inf,
String delimiter,
String enclosure,
String escapeCharacter) |
static long |
skipLines(LogChannelInterface log,
InputStreamReader reader,
EncodingType encodingType,
int fileFormatType,
StringBuilder line,
int nrLinesToSkip,
String regex,
long lineNumberInFile)
Returns the line number in file
|
public static final String[] guessStringsFromLine(VariableSpace space, LogChannelInterface log, String line, TextFileInputMeta inf, String delimiter, String enclosure, String escapeCharacter) throws KettleException
KettleException
public static final String getLine(LogChannelInterface log, InputStreamReader reader, int formatNr, StringBuilder line) throws KettleFileException
KettleFileException
public static final String getLine(LogChannelInterface log, InputStreamReader reader, EncodingType encodingType, int fileFormatType, StringBuilder line, String regex) throws KettleFileException
KettleFileException
public static final TextFileLine getLine(LogChannelInterface log, InputStreamReader reader, EncodingType encodingType, int fileFormatType, StringBuilder line, String regex, long lineNumberInFile) throws KettleFileException
KettleFileException
public static final String getLine(LogChannelInterface log, InputStreamReader reader, EncodingType encodingType, int formatNr, StringBuilder line) throws KettleFileException
KettleFileException
public static final Object[] convertLineToRow(LogChannelInterface log, TextFileLine textFileLine, TextFileInputMeta info, Object[] passThruFields, int nrPassThruFields, RowMetaInterface outputRowMeta, RowMetaInterface convertRowMeta, String fname, long rowNr, String delimiter, String enclosure, String escapeCharacter, FileErrorHandler errorHandler, BaseFileInputAdditionalField additionalOutputFields, String shortFilename, String path, boolean hidden, Date modificationDateTime, String uri, String rooturi, String extension, Long size) throws KettleException
KettleException
public static final Object[] convertLineToRow(LogChannelInterface log, TextFileLine textFileLine, TextFileInputMeta info, Object[] passThruFields, int nrPassThruFields, RowMetaInterface outputRowMeta, RowMetaInterface convertRowMeta, String fname, long rowNr, String delimiter, String enclosure, String escapeCharacter, FileErrorHandler errorHandler, BaseFileInputAdditionalField additionalOutputFields, String shortFilename, String path, boolean hidden, Date modificationDateTime, String uri, String rooturi, String extension, Long size, boolean failOnParseError) throws KettleException
failOnParseError
- if set to true, parsing failure on any line will cause parsing to be terminated; when
set to false, parsing failure on a given line will not prevent remaining lines from
being parsed - this allows us to analyze fields, even if some field is mis-configured
and causes a parsing error for the values of that field.KettleException
public static final String[] convertLineToStrings(LogChannelInterface log, String line, TextFileInputMeta inf, String delimiter, String enclosure, String escapeCharacters) throws KettleException
KettleException
public static int checkPattern(String text, String regex)
text
- String to be evaluatedregex
- String patternpublic static long skipLines(LogChannelInterface log, InputStreamReader reader, EncodingType encodingType, int fileFormatType, StringBuilder line, int nrLinesToSkip, String regex, long lineNumberInFile) throws KettleFileException
KettleFileException
Copyright © 2020 Hitachi Vantara. All rights reserved.