I am reading .csv files into R that were produced by software that adds extra labels to the data it exports, without placing commas following these extra labels. A simplified version of the text file can be seen in the following image.
When I import using the read.csv() function and view the data I get the following:
I then tried read.csv2, and wrote a new file removing the first two rows:
Modified to:
This is displayed in a text file as:
This is becoming a laborious task, and I am wondering whether there is a more efficient way of tidying up the files (as I have a lot of them).
Basically what I am trying to do is create a .csv file that when read into R has two columns with the first headed "Time [s]" and the second column headed "Function" The header "x" is not followed by a comma when exported as a new .csv file and is preventing me from reading my file into R in the form that I described.
The data can be copied and pasted (I think), using:
structure(list(X.Name. = c("", "", "Function", "0.00E+00", "4.00E+00", "6.50E+00", "7.10E+00", "3.00E+00")), class = "data.frame", row.names = c("Series 1 at Function Used", "[Data]", "Time [ s ]", "0.00E+00", "5.00E+00", "1.00E+01", "1.50E+01", "2.00E+01"))