read.item.character  <-  function(data, code){
  # returns string w/o leading or trailing whitespace
  trim <- function (x) gsub("^\\s+|\\s+$", "", x)
  line  <-	data[grep(code, data)]
  if (!is.null(line)){
    return(trim(substring( line, regexpr(" ", line) + 1, nchar(line))))

Try the HITXML package in your browser

Any scripts or data that you put into this service are public.

HITXML documentation built on May 2, 2019, 5:25 p.m.