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 lines are imported to a vector. This would work fine with
impcoord<-read.table("file.txt",skip= ,nrow= ,...)
but the files print the coordinate sets after different lengths of supporting parameters.
Luckily the coordinates always start after a line containing certain words.
Thus my question is, how do I start reading the .txt-file after these words? Let's say they are:
coordinatesXY
Thanks alot for your time and help!
-Olli
--Edit--
Sorry for the confusion.
The part of the file is as follows:
##XYDATA= (X++(Y..Y))
131071 -2065
131070 -4137
131069 -6408
131068 -8043
... ...
... ...
The first line being the one where skip
should end and the following coordinates need to be imported to a vector. As you can see the X-coordinates start from 131071 and end to 0.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…