I have a bunch of output .txt-files that consists of a large parameter list and a X-Y-coordinate set. I need to extract these coordinates from all files so that only those l
This looks like a job for data.table's fread
library(data.table)
impcoord <- fread("file.txt",skip="coordinatesXY")
--edit--
That is why it is good to give a reproducible example. That error means your file is causing trouble.
The skip command matches the text you give it to the file to identify what line to start at, so you need to give it a unique string from the start of the line that you want it to start reading from. That function would work for something like this:
## some random text
## some more random text
## More random text
table_heading1, table_heading2, table_heading3 ...etc
value1, value2, value3 ... etc
etc
Just_The_Table <- fread("the_above_as_a_text_file.txt", skip="table_heading1", header=T)