VTK
|
reads in delimited ascii or unicode text files and outputs a vtkTable data structure. More...
#include <vtkDelimitedTextReader.h>
reads in delimited ascii or unicode text files and outputs a vtkTable data structure.
vtkDelimitedTextReader is an interface for pulling in data from a flat, delimited ascii or unicode text file (delimiter can be any character).
The behavior of the reader with respect to ascii or unicode input is controlled by the SetUnicodeCharacterSet() method. By default (without calling SetUnicodeCharacterSet()), the reader will expect to read ascii text and will output vtkStdString columns. Use the Set and Get methods to set delimiters that do not contain UTF8 in the name when operating the reader in default ascii mode. If the SetUnicodeCharacterSet() method is called, the reader will output vtkUnicodeString columns in the output table. In addition, it is necessary to use the Set and Get methods that contain UTF8 in the name to specify delimiters when operating in unicode mode.
There is also a special character set US-ASCII-WITH-FALLBACK that will treat the input text as ASCII no matter what. If and when it encounters a character with its 8th bit set it will replace that character with the code point ReplacementCharacter. You may use this if you have text that belongs to a code page like LATIN9 or ISO-8859-1 or friends: mostly ASCII but not entirely. Eventually this class will acquire the ability to read gracefully text from any code page, making this option obsolete.
This class emits ProgressEvent for every 100 lines it reads.
Definition at line 77 of file vtkDelimitedTextReader.h.
Reimplemented from vtkTableAlgorithm.
Definition at line 81 of file vtkDelimitedTextReader.h.
vtkDelimitedTextReader::vtkDelimitedTextReader | ( | ) | [protected] |
vtkDelimitedTextReader::~vtkDelimitedTextReader | ( | ) | [protected] |
static vtkDelimitedTextReader* vtkDelimitedTextReader::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkTableAlgorithm.
static int vtkDelimitedTextReader::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkTableAlgorithm.
virtual int vtkDelimitedTextReader::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkTableAlgorithm.
static vtkDelimitedTextReader* vtkDelimitedTextReader::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkTableAlgorithm.
virtual vtkObjectBase* vtkDelimitedTextReader::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkTableAlgorithm.
Reimplemented from vtkTableAlgorithm.
void vtkDelimitedTextReader::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkTableAlgorithm.
virtual char* vtkDelimitedTextReader::GetFileName | ( | ) | [virtual] |
Specifies the delimited text file to be loaded.
virtual void vtkDelimitedTextReader::SetFileName | ( | const char * | ) | [virtual] |
Specifies the delimited text file to be loaded.
void vtkDelimitedTextReader::SetInputString | ( | const char * | in | ) |
Specify the InputString for use when reading from a character array. Optionally include the length for binary strings. Note that a copy of the string is made and stored. If this causes exceedingly large memory consumption, consider using InputArray instead.
virtual char* vtkDelimitedTextReader::GetInputString | ( | ) | [virtual] |
Specify the InputString for use when reading from a character array. Optionally include the length for binary strings. Note that a copy of the string is made and stored. If this causes exceedingly large memory consumption, consider using InputArray instead.
void vtkDelimitedTextReader::SetInputString | ( | const char * | in, |
int | len | ||
) |
Specify the InputString for use when reading from a character array. Optionally include the length for binary strings. Note that a copy of the string is made and stored. If this causes exceedingly large memory consumption, consider using InputArray instead.
virtual int vtkDelimitedTextReader::GetInputStringLength | ( | ) | [virtual] |
Specify the InputString for use when reading from a character array. Optionally include the length for binary strings. Note that a copy of the string is made and stored. If this causes exceedingly large memory consumption, consider using InputArray instead.
void vtkDelimitedTextReader::SetInputString | ( | const vtkStdString & | input | ) | [inline] |
Specify the InputString for use when reading from a character array. Optionally include the length for binary strings. Note that a copy of the string is made and stored. If this causes exceedingly large memory consumption, consider using InputArray instead.
Definition at line 99 of file vtkDelimitedTextReader.h.
virtual void vtkDelimitedTextReader::SetReadFromInputString | ( | int | ) | [virtual] |
Enable reading from an InputString or InputArray instead of the default, a file.
virtual int vtkDelimitedTextReader::GetReadFromInputString | ( | ) | [virtual] |
Enable reading from an InputString or InputArray instead of the default, a file.
virtual void vtkDelimitedTextReader::ReadFromInputStringOn | ( | ) | [virtual] |
Enable reading from an InputString or InputArray instead of the default, a file.
virtual void vtkDelimitedTextReader::ReadFromInputStringOff | ( | ) | [virtual] |
Enable reading from an InputString or InputArray instead of the default, a file.
virtual char* vtkDelimitedTextReader::GetUnicodeCharacterSet | ( | ) | [virtual] |
Specifies the character set used in the input file. Valid character set names will be drawn from the list maintained by the Internet Assigned Name Authority at http://www.iana.org/assignments/character-sets Where multiple aliases are provided for a character set, the preferred MIME name will be used. vtkUnicodeDelimitedTextReader currently supports "US-ASCII", "UTF-8", "UTF-16", "UTF-16BE", and "UTF-16LE" character sets.
virtual void vtkDelimitedTextReader::SetUnicodeCharacterSet | ( | const char * | ) | [virtual] |
Specifies the character set used in the input file. Valid character set names will be drawn from the list maintained by the Internet Assigned Name Authority at http://www.iana.org/assignments/character-sets Where multiple aliases are provided for a character set, the preferred MIME name will be used. vtkUnicodeDelimitedTextReader currently supports "US-ASCII", "UTF-8", "UTF-16", "UTF-16BE", and "UTF-16LE" character sets.
void vtkDelimitedTextReader::SetUTF8RecordDelimiters | ( | const char * | delimiters | ) |
Specify the character(s) that will be used to separate records. The order of characters in the string does not matter. Defaults to "\r\n".
const char* vtkDelimitedTextReader::GetUTF8RecordDelimiters | ( | ) |
Specify the character(s) that will be used to separate records. The order of characters in the string does not matter. Defaults to "\r\n".
void vtkDelimitedTextReader::SetUnicodeRecordDelimiters | ( | const vtkUnicodeString & | delimiters | ) |
Specify the character(s) that will be used to separate records. The order of characters in the string does not matter. Defaults to "\r\n".
Specify the character(s) that will be used to separate records. The order of characters in the string does not matter. Defaults to "\r\n".
virtual void vtkDelimitedTextReader::SetFieldDelimiterCharacters | ( | const char * | ) | [virtual] |
Specify the character(s) that will be used to separate fields. For example, set this to "," for a comma-separated value file. Set it to ".:;" for a file where columns can be separated by a period, colon or semicolon. The order of the characters in the string does not matter. Defaults to a comma.
virtual char* vtkDelimitedTextReader::GetFieldDelimiterCharacters | ( | ) | [virtual] |
Specify the character(s) that will be used to separate fields. For example, set this to "," for a comma-separated value file. Set it to ".:;" for a file where columns can be separated by a period, colon or semicolon. The order of the characters in the string does not matter. Defaults to a comma.
void vtkDelimitedTextReader::SetUTF8FieldDelimiters | ( | const char * | delimiters | ) |
const char* vtkDelimitedTextReader::GetUTF8FieldDelimiters | ( | ) |
void vtkDelimitedTextReader::SetUnicodeFieldDelimiters | ( | const vtkUnicodeString & | delimiters | ) |
virtual char vtkDelimitedTextReader::GetStringDelimiter | ( | ) | [virtual] |
Get/set the character that will begin and end strings. Microsoft Excel, for example, will export the following format: "First Field","Second Field","Field, With, Commas","Fourth Field" The third field has a comma in it. By using a string delimiter, this will be correctly read. The delimiter defaults to '"'.
virtual void vtkDelimitedTextReader::SetStringDelimiter | ( | char | ) | [virtual] |
Get/set the character that will begin and end strings. Microsoft Excel, for example, will export the following format: "First Field","Second Field","Field, With, Commas","Fourth Field" The third field has a comma in it. By using a string delimiter, this will be correctly read. The delimiter defaults to '"'.
void vtkDelimitedTextReader::SetUTF8StringDelimiters | ( | const char * | delimiters | ) |
const char* vtkDelimitedTextReader::GetUTF8StringDelimiters | ( | ) |
void vtkDelimitedTextReader::SetUnicodeStringDelimiters | ( | const vtkUnicodeString & | delimiters | ) |
virtual void vtkDelimitedTextReader::SetUseStringDelimiter | ( | bool | ) | [virtual] |
Set/get whether to use the string delimiter. Defaults to on.
virtual bool vtkDelimitedTextReader::GetUseStringDelimiter | ( | ) | [virtual] |
Set/get whether to use the string delimiter. Defaults to on.
virtual void vtkDelimitedTextReader::UseStringDelimiterOn | ( | ) | [virtual] |
Set/get whether to use the string delimiter. Defaults to on.
virtual void vtkDelimitedTextReader::UseStringDelimiterOff | ( | ) | [virtual] |
Set/get whether to use the string delimiter. Defaults to on.
virtual bool vtkDelimitedTextReader::GetHaveHeaders | ( | ) | [virtual] |
Set/get whether to treat the first line of the file as headers. The default is false (no headers).
virtual void vtkDelimitedTextReader::SetHaveHeaders | ( | bool | ) | [virtual] |
Set/get whether to treat the first line of the file as headers. The default is false (no headers).
virtual void vtkDelimitedTextReader::SetMergeConsecutiveDelimiters | ( | bool | ) | [virtual] |
Set/get whether to merge successive delimiters. Use this if (for example) your fields are separated by spaces but you don't know exactly how many.
virtual bool vtkDelimitedTextReader::GetMergeConsecutiveDelimiters | ( | ) | [virtual] |
Set/get whether to merge successive delimiters. Use this if (for example) your fields are separated by spaces but you don't know exactly how many.
virtual void vtkDelimitedTextReader::MergeConsecutiveDelimitersOn | ( | ) | [virtual] |
Set/get whether to merge successive delimiters. Use this if (for example) your fields are separated by spaces but you don't know exactly how many.
virtual void vtkDelimitedTextReader::MergeConsecutiveDelimitersOff | ( | ) | [virtual] |
Set/get whether to merge successive delimiters. Use this if (for example) your fields are separated by spaces but you don't know exactly how many.
virtual vtkIdType vtkDelimitedTextReader::GetMaxRecords | ( | ) | [virtual] |
Specifies the maximum number of records to read from the file. Limiting the number of records to read is useful for previewing the contents of a file.
virtual void vtkDelimitedTextReader::SetMaxRecords | ( | vtkIdType | ) | [virtual] |
Specifies the maximum number of records to read from the file. Limiting the number of records to read is useful for previewing the contents of a file.
virtual void vtkDelimitedTextReader::SetDetectNumericColumns | ( | bool | ) | [virtual] |
When set to true, the reader will detect numeric columns and create vtkDoubleArray or vtkIntArray for those instead of vtkStringArray. Default is off.
virtual bool vtkDelimitedTextReader::GetDetectNumericColumns | ( | ) | [virtual] |
When set to true, the reader will detect numeric columns and create vtkDoubleArray or vtkIntArray for those instead of vtkStringArray. Default is off.
virtual void vtkDelimitedTextReader::DetectNumericColumnsOn | ( | ) | [virtual] |
When set to true, the reader will detect numeric columns and create vtkDoubleArray or vtkIntArray for those instead of vtkStringArray. Default is off.
virtual void vtkDelimitedTextReader::DetectNumericColumnsOff | ( | ) | [virtual] |
When set to true, the reader will detect numeric columns and create vtkDoubleArray or vtkIntArray for those instead of vtkStringArray. Default is off.
virtual void vtkDelimitedTextReader::SetForceDouble | ( | bool | ) | [virtual] |
When set to true and DetectNumericColumns is also true, forces all numeric columns to vtkDoubleArray even if they contain only integer values. Default is off.
virtual bool vtkDelimitedTextReader::GetForceDouble | ( | ) | [virtual] |
When set to true and DetectNumericColumns is also true, forces all numeric columns to vtkDoubleArray even if they contain only integer values. Default is off.
virtual void vtkDelimitedTextReader::ForceDoubleOn | ( | ) | [virtual] |
When set to true and DetectNumericColumns is also true, forces all numeric columns to vtkDoubleArray even if they contain only integer values. Default is off.
virtual void vtkDelimitedTextReader::ForceDoubleOff | ( | ) | [virtual] |
When set to true and DetectNumericColumns is also true, forces all numeric columns to vtkDoubleArray even if they contain only integer values. Default is off.
virtual void vtkDelimitedTextReader::SetTrimWhitespacePriorToNumericConversion | ( | bool | ) | [virtual] |
When DetectNumericColumns is set to true, whether to trim whitespace from strings prior to conversion to a numeric. Default is false to preserve backward compatibility. vtkVariant handles whitespace inconsistently, so trim it before we try to convert it. For example: vtkVariant(" 2.0").ToDouble() == 2.0 <-- leading whitespace is not a problem vtkVariant(" 2.0 ").ToDouble() == NaN <-- trailing whitespace is a problem vtkVariant(" infinity ").ToDouble() == NaN <-- any whitespace is a problem In these cases, trimming the whitespace gives us the result we expect: 2.0 and INF respectively.
virtual bool vtkDelimitedTextReader::GetTrimWhitespacePriorToNumericConversion | ( | ) | [virtual] |
When DetectNumericColumns is set to true, whether to trim whitespace from strings prior to conversion to a numeric. Default is false to preserve backward compatibility. vtkVariant handles whitespace inconsistently, so trim it before we try to convert it. For example: vtkVariant(" 2.0").ToDouble() == 2.0 <-- leading whitespace is not a problem vtkVariant(" 2.0 ").ToDouble() == NaN <-- trailing whitespace is a problem vtkVariant(" infinity ").ToDouble() == NaN <-- any whitespace is a problem In these cases, trimming the whitespace gives us the result we expect: 2.0 and INF respectively.
virtual void vtkDelimitedTextReader::TrimWhitespacePriorToNumericConversionOn | ( | ) | [virtual] |
When DetectNumericColumns is set to true, whether to trim whitespace from strings prior to conversion to a numeric. Default is false to preserve backward compatibility. vtkVariant handles whitespace inconsistently, so trim it before we try to convert it. For example: vtkVariant(" 2.0").ToDouble() == 2.0 <-- leading whitespace is not a problem vtkVariant(" 2.0 ").ToDouble() == NaN <-- trailing whitespace is a problem vtkVariant(" infinity ").ToDouble() == NaN <-- any whitespace is a problem In these cases, trimming the whitespace gives us the result we expect: 2.0 and INF respectively.
virtual void vtkDelimitedTextReader::TrimWhitespacePriorToNumericConversionOff | ( | ) | [virtual] |
When DetectNumericColumns is set to true, whether to trim whitespace from strings prior to conversion to a numeric. Default is false to preserve backward compatibility. vtkVariant handles whitespace inconsistently, so trim it before we try to convert it. For example: vtkVariant(" 2.0").ToDouble() == 2.0 <-- leading whitespace is not a problem vtkVariant(" 2.0 ").ToDouble() == NaN <-- trailing whitespace is a problem vtkVariant(" infinity ").ToDouble() == NaN <-- any whitespace is a problem In these cases, trimming the whitespace gives us the result we expect: 2.0 and INF respectively.
virtual void vtkDelimitedTextReader::SetDefaultIntegerValue | ( | int | ) | [virtual] |
When DetectNumericColumns is set to true, the reader use this value to populate the vtkIntArray where empty strings are found. Default is 0.
virtual int vtkDelimitedTextReader::GetDefaultIntegerValue | ( | ) | [virtual] |
When DetectNumericColumns is set to true, the reader use this value to populate the vtkIntArray where empty strings are found. Default is 0.
virtual void vtkDelimitedTextReader::SetDefaultDoubleValue | ( | double | ) | [virtual] |
When DetectNumericColumns is set to true, the reader use this value to populate the vtkDoubleArray where empty strings are found. Default is 0.0
virtual double vtkDelimitedTextReader::GetDefaultDoubleValue | ( | ) | [virtual] |
When DetectNumericColumns is set to true, the reader use this value to populate the vtkDoubleArray where empty strings are found. Default is 0.0
virtual void vtkDelimitedTextReader::SetPedigreeIdArrayName | ( | const char * | ) | [virtual] |
The name of the array for generating or assigning pedigree ids (default "id").
virtual char* vtkDelimitedTextReader::GetPedigreeIdArrayName | ( | ) | [virtual] |
The name of the array for generating or assigning pedigree ids (default "id").
virtual void vtkDelimitedTextReader::SetGeneratePedigreeIds | ( | bool | ) | [virtual] |
If on (default), generates pedigree ids automatically. If off, assign one of the arrays to be the pedigree id.
virtual bool vtkDelimitedTextReader::GetGeneratePedigreeIds | ( | ) | [virtual] |
If on (default), generates pedigree ids automatically. If off, assign one of the arrays to be the pedigree id.
virtual void vtkDelimitedTextReader::GeneratePedigreeIdsOn | ( | ) | [virtual] |
If on (default), generates pedigree ids automatically. If off, assign one of the arrays to be the pedigree id.
virtual void vtkDelimitedTextReader::GeneratePedigreeIdsOff | ( | ) | [virtual] |
If on (default), generates pedigree ids automatically. If off, assign one of the arrays to be the pedigree id.
virtual void vtkDelimitedTextReader::SetOutputPedigreeIds | ( | bool | ) | [virtual] |
If on, assigns pedigree ids to output. Defaults to off.
virtual bool vtkDelimitedTextReader::GetOutputPedigreeIds | ( | ) | [virtual] |
If on, assigns pedigree ids to output. Defaults to off.
virtual void vtkDelimitedTextReader::OutputPedigreeIdsOn | ( | ) | [virtual] |
If on, assigns pedigree ids to output. Defaults to off.
virtual void vtkDelimitedTextReader::OutputPedigreeIdsOff | ( | ) | [virtual] |
If on, assigns pedigree ids to output. Defaults to off.
Returns a human-readable description of the most recent error, if any. Otherwise, returns an empty string. Note that the result is only valid after calling Update().
virtual void vtkDelimitedTextReader::SetReplacementCharacter | ( | vtkTypeUInt32 | ) | [virtual] |
Fallback character for use in the US-ASCII-WITH-FALLBACK character set. Any characters that have their 8th bit set will be replaced with this code point. Defaults to 'x'.
virtual vtkTypeUInt32 vtkDelimitedTextReader::GetReplacementCharacter | ( | ) | [virtual] |
Fallback character for use in the US-ASCII-WITH-FALLBACK character set. Any characters that have their 8th bit set will be replaced with this code point. Defaults to 'x'.
int vtkDelimitedTextReader::RequestData | ( | vtkInformation * | request, |
vtkInformationVector ** | inputVector, | ||
vtkInformationVector * | outputVector | ||
) | [protected, virtual] |
This is called by the superclass. This is the method you should override.
Reimplemented from vtkTableAlgorithm.
char* vtkDelimitedTextReader::FileName [protected] |
Definition at line 289 of file vtkDelimitedTextReader.h.
int vtkDelimitedTextReader::ReadFromInputString [protected] |
Definition at line 290 of file vtkDelimitedTextReader.h.
char* vtkDelimitedTextReader::InputString [protected] |
Definition at line 291 of file vtkDelimitedTextReader.h.
int vtkDelimitedTextReader::InputStringLength [protected] |
Definition at line 292 of file vtkDelimitedTextReader.h.
char* vtkDelimitedTextReader::UnicodeCharacterSet [protected] |
Definition at line 293 of file vtkDelimitedTextReader.h.
vtkIdType vtkDelimitedTextReader::MaxRecords [protected] |
Definition at line 294 of file vtkDelimitedTextReader.h.
Definition at line 295 of file vtkDelimitedTextReader.h.
Definition at line 296 of file vtkDelimitedTextReader.h.
Definition at line 297 of file vtkDelimitedTextReader.h.
Definition at line 298 of file vtkDelimitedTextReader.h.
Definition at line 299 of file vtkDelimitedTextReader.h.
bool vtkDelimitedTextReader::DetectNumericColumns [protected] |
Definition at line 300 of file vtkDelimitedTextReader.h.
bool vtkDelimitedTextReader::ForceDouble [protected] |
Definition at line 301 of file vtkDelimitedTextReader.h.
bool vtkDelimitedTextReader::TrimWhitespacePriorToNumericConversion [protected] |
Definition at line 302 of file vtkDelimitedTextReader.h.
int vtkDelimitedTextReader::DefaultIntegerValue [protected] |
Definition at line 303 of file vtkDelimitedTextReader.h.
double vtkDelimitedTextReader::DefaultDoubleValue [protected] |
Definition at line 304 of file vtkDelimitedTextReader.h.
char* vtkDelimitedTextReader::FieldDelimiterCharacters [protected] |
Definition at line 305 of file vtkDelimitedTextReader.h.
char vtkDelimitedTextReader::StringDelimiter [protected] |
Definition at line 306 of file vtkDelimitedTextReader.h.
bool vtkDelimitedTextReader::UseStringDelimiter [protected] |
Definition at line 307 of file vtkDelimitedTextReader.h.
bool vtkDelimitedTextReader::HaveHeaders [protected] |
Definition at line 308 of file vtkDelimitedTextReader.h.
bool vtkDelimitedTextReader::UnicodeOutputArrays [protected] |
Definition at line 309 of file vtkDelimitedTextReader.h.
bool vtkDelimitedTextReader::MergeConsecutiveDelimiters [protected] |
Definition at line 310 of file vtkDelimitedTextReader.h.
char* vtkDelimitedTextReader::PedigreeIdArrayName [protected] |
Definition at line 311 of file vtkDelimitedTextReader.h.
bool vtkDelimitedTextReader::GeneratePedigreeIds [protected] |
Definition at line 312 of file vtkDelimitedTextReader.h.
bool vtkDelimitedTextReader::OutputPedigreeIds [protected] |
Definition at line 313 of file vtkDelimitedTextReader.h.
vtkStdString vtkDelimitedTextReader::LastError [protected] |
Definition at line 314 of file vtkDelimitedTextReader.h.
vtkTypeUInt32 vtkDelimitedTextReader::ReplacementCharacter [protected] |
Definition at line 315 of file vtkDelimitedTextReader.h.