parseText: Parse text in character vector into individual elements by...

Description Usage Arguments Details Value

View source: R/parseText.R

Description

Function to parse text in character vector into individual elements by quotes and whitespace, keeping quoted text together in same element (with whitespace but without quotation marks).

Usage

1
2
parseText(strv, qt = "'", keepQuotes = FALSE, stripComments = TRUE,
  comment = "#")

Arguments

strv

- chracter vector to parse

qt

- the character indicating quotation (' or ")

keepQuotes

- flag to keep the quotation marks in the output (does nothing)

stripComments

- flag to remove comments prior to parsing

comment

- character used to indicate the start of a comment

Details

Each element in the returned list is a character vector whose elements consist of 1) quoted text blocks and 2) unquoted text elements split by white space in the order they occur in the element of the character vector.

Value

numbered list, with elements corresponding to the equivalent vector element in strv AFTER comments have been removed.


wStockhausen/wtsUtilities documentation built on Oct. 23, 2018, 10:27 p.m.