LaF (version 0.6.3)

laf_open_fwf: Create a connection to a fixed width file.

Description

A connection to the file filename is created. Column types have to be specified. These are not determined automatically as for example read.fwf does. This has been done to increase speed.

Usage

laf_open_fwf(filename, column_types, column_widths, column_names = paste("V",
  seq_len(length(column_types)), sep = ""), dec = ".", trim = TRUE)

Arguments

filename

character containing the filename of the CSV-file.

column_types

character vector containing the types of data in each of the columns. Valid types are: double, integer, categorical and string.

column_widths

numeric vector containing the width in number of character of each of the columns.

column_names

optional character vector containing the names of the columns.

dec

optional character specifying the decimal mark.

trim

optional logical specifying whether or not whitespace at the end of factor levels or character strings should be trimmed.

Value

Object of type '>laf. Values can be extracted from this object using indexing, and methods such as read_lines, next_block.

Details

After the connection is created data can be extracted using indexing (as in a normal data.frame) or methods such as read_lines and next_block can be used to read in blocks. For processing the file in blocks the (faster) convenience function process_blocks can be used.

See Also

See read.fwf for conventional access of fixed width files.