Importing a txt file when number of columns varies?

I have problems importing a .txt file into R because the number columns changes from eight to nine. Initially, my data has eight columns:

Date, Open, High, Low, Close, Volume, Open Interest, Delivery Month

Later, I add an additional column Unadjusted close. How should I import the data? Somehow the Unadjusted close column has to be ignored at the beginning. I've tried

data1 <- read.table("AD_0.TXT", sep=",", header=TRUE)

but that doesn't work.

7
задан csgillespie 23 March 2011 в 09:29
поделиться