class Crowbar::Selectors::DelimitedField

Overview

Selects the N-th field or column delimited by a separator (e.g. CSV column, passwd line). Supports per-record (line-by-line) evaluation or global streaming evaluation.

Defined in:

crowbar/selectors/delimited_field.cr

Constructors

Instance Method Summary

Instance methods inherited from class Crowbar::Selector

&(other : Selector) : Selector &, |(other : Selector) : Selector |, ~ : Selector ~, select(buffer : Buffer) : Array(Tuple(Int32, Int32)) select, weight : Float64 weight, weight=(weight : Float64) weight=

Constructor methods inherited from class Crowbar::Selector

new(weight : Float64 = 1.0) new

Constructor Detail

def self.new(field_index : Int32, delimiter : UInt8 | Char | String = ',', line_delimited : Bool = true, handle_quotes : Bool = true, weight : Float64 = 1.0) #

Instance Method Detail

def delimiter : UInt8 #

def field_index : Int32 #

def handle_quotes? : Bool #

def line_delimited? : Bool #

def select(buffer : Buffer) : Array(Tuple(Int32, Int32)) #
Description copied from class Crowbar::Selector

Returns an array of target ranges {start_index, end_index_exclusive}