title: how do you convert output from readLines to data frame in R
body: <p>I have a txt file that has multiple lines. Each line as text that is separated by space. Number of columns in each line may be different. I need to read each line one at a time, put it into data frame and print it.</p>
  
  <p>I tried this:</p>
  
  <pre><code>x&lt;-readLines("output.txt")
  
  
  for (i in 2:length(x) ) {
    data&lt;-data.frame(x[[i]])
    print(data)
  }
  </code></pre>
  
  <p>I have to start from line number 2 becasuse line number 1 has some heading info that I dont need.</p>
  
  <p>For example, this prints out something like this:</p>
  
  <pre><code>x[[2]]
  [1] "                              dcserver        AIX      2254438400       587317248   026.05   93752=100.00  HDS93752_VMAX1561_RAID1=100.00 "
  </code></pre>
  
  <p>when I do this:</p>
  
  <pre><code>data&lt;-data.frame(x[[2]])
  </code></pre>
  
  <p>I get this:</p>
  
  <pre><code>dput(data)
  
  structure(list(x..2.. = structure(1L, .Label = "                              dcserver        AIX      2254438400       587317248   026.05   93752=100.00  HDS93752_VMAX1561_RAID1=100.00 ", class = "factor")), .Names = "x..2..", row.names = c(NA, 
  -1L), class = "data.frame")
  </code></pre>
  
  <p>It looks like I have one row and one column, I need to have 7 columns, like below:</p>
  
  <pre><code>dcserver        AIX      2254438400       587317248   026.05   93752=100.00  HDS93752_VMAX1561_RAID1=100.00
  </code></pre>
  
  <p>Any ideas?</p>