I have a folder with 396 csv files.
The first 25 rows of each csv file is the same and so i want to skip them.Next, the 26th row is the header row that i want to keep.
The problem is that the information i am interested in starts in different rows in the csv files.Some start at row 48, others at 36, 32... etc.I want to skip the rows after my header to the start of the row of the needed information. Is there a way to skip the first 25 rows, keep header row (26th), and automate it such that R skips rows after my header until it sees start row with the information.
Additionally, once i reach the row i want,the values is represented every other row or other 2 rows.is there a way to solve this since it is not consistent?
Example:
1. Name
2....
.
.
25...
26.Header
27....
.
.
32/41/etc 12/04/2015 13:49 4 6
I am not sure what code to use but i started thinking of using this code:
files<-list.files("filepath",pattern="*csv", full.names=T)
names(files)<-files
headers = read.csv(files, skip = 1:25, header = F, as.is = T)
edata <- do.call(rbind, lapply(files, read_csv))
I am not sure how to handle skip issue in the do.call.
Has anyone run into a similar issue and how did you solve it?
Thank you.
skip=25
. Then, Is there any pattern in the rows you want to keep? Are the rows you want to discard just missing values? Just, copy a real example of your dataskip = 25
and then delete empty rows....