read_strings {conmolfields}R Documentation

read ncount string tokens

Description

read ncount string tokens

Usage

read_strings(count)

Arguments

count

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
 # read ncount string tokens
  read_strings <- function(count) {
	res <- character(count)
    icount <- 0
	while (icount < count) {
	  next_line()
	  tokens <- strsplit(aline, " +", perl=TRUE)[[1]]
	  ntokens <- length(tokens)
	  for (itoken in 2:ntokens) {
	    token <- tokens[itoken]
		res[icount+itoken-1] <- token
	  }
	  icount <- icount + ntokens - 1
	}
	res
  }

[Package conmolfields version 0.0-19 Index]