Data Integrator (Python API)
|
Implements reading of TSV files. More...
Public Member Functions | |
def | __init__ (s, ffn) |
Ctor. More... | |
def | __iter__ (s) |
Return the iterable object, needed for for/while loops. More... | |
def | next (s) |
def | IsEmpty (s, verbose=False) |
Checks if a file is empty. More... | |
def | GetHeader (s, verbose=False) |
Get the first line of this file. More... | |
def | GetLineNr (s) |
Get current line number. More... | |
def | GetReader (s) |
![]() | |
def | IsValid (s) |
Check if the object is ready for reading/writing. More... | |
def | Close (s) |
Close the file object associated with the file name. More... | |
Additional Inherited Members | |
![]() | |
COL_SEP = CSV_SEP; | |
QUOTING = csv.QUOTE_NONE; | |
string | ESCAPE_CHAR = "\\"; |
Implements reading of TSV files.
def cls.DefaultTable.CDefaultTableReader.__init__ | ( | s, | |
ffn | |||
) |
Ctor.
@param ffn Full path file name. If it is set to '-', the standard input or output will be opened instead.
Reimplemented from cls.DefaultTable.CDefaultTableBase.
Reimplemented in cls.DefaultTable.CVcfTableReader.
def cls.DefaultTable.CDefaultTableReader.__iter__ | ( | s | ) |
Return the iterable object, needed for for/while loops.
def cls.DefaultTable.CDefaultTableReader.GetHeader | ( | s, | |
verbose = False |
|||
) |
Get the first line of this file.
The caller has to decide if there is a header in the file. This method reads the first line of a stream and advances the file pointer to the next line. If the first line has already been written, it will nevertheless report the first line read. @param verbose If @c True, an error will be written if the input is empty and no header can be read. @return The columns of the first line or an empty @c List if the file itself is empty.
def cls.DefaultTable.CDefaultTableReader.GetLineNr | ( | s | ) |
Get current line number.
@return Line number (@c int).
def cls.DefaultTable.CDefaultTableReader.GetReader | ( | s | ) |
@return @c csv.reader instance for more sophisticated operations. Be aware though, that using this instance will interfere with the states stored in this wrapper class and may result in unanticipated outcomes.
def cls.DefaultTable.CDefaultTableReader.IsEmpty | ( | s, | |
verbose = False |
|||
) |
Checks if a file is empty.
This method can be called at any time. @param verbose If @c True, a warning will be written if an empty file is detected. If @c False, the method will run silently. @return @c True if the file or stream is empty. @c False if the file contains some content.
def cls.DefaultTable.CDefaultTableReader.next | ( | s | ) |
Mirrors the iterator's next() method and does some housekeeping.