Re: [R] field values from text file to dataframe

2017-03-13 Thread Ulrik Stervbo
I imagine that the FieldStateOption is irrelevant, so you might be able to create a data.frame like this: library(tidyr) fl <- readLines("pdf_dump.txt") fl <- grep("FieldStateOption", fl, value = TRUE, invert = TRUE) field_number <- vector(mode = "integer", length = length(fl)) tmpid <- 0 for(i

Re: [R] field values from text file to dataframe

2017-03-13 Thread Jim Lemon
Hi Vijayan, You have a bit of a problem with repeated field names. While you can mangle the field names to do something like this, I don't see how you are going to make sense of multiple "FieldStateOption" fields. The strategy I would take is to collect all of the field names and then set up rows w