title: Split lines and create new dataframe
body: <p>I have a file, file.txt, with data that looks like as follows,</p>
  
  <pre><code>&lt;z:row ows_Req_Name1='John' ows_ReqPriority='High' ows_ReqDate='2012-10-10' /&gt;
  &lt;z:row ows_Req_Name1='Jack' ows_ReqPriority='Low' ows_ReqDate='2012-11-10' /&gt;
  &lt;z:row ows_Req_Name1='John' ows_ReqDate='2012-12-10' /&gt;
  </code></pre>
  
  <p>Not all lines contain all the required information. For eg., the last line above does not have  an entry for ReqPriority like the other lines. I split the data into a dataframe using,</p>
  
  <pre><code>data.frame(do.call(rbind,strsplit(readLines('file.txt'),'ows_',fixed=T)))
  </code></pre>
  
  <p>but due to the missing entries in some of the lines the dataframe does not come out properly.</p>
  
  <p>Any suggestions on how I can export this into a df and fill in the missing values with NA.</p>
  
  <pre><code>Req_Name1   ReqPriority    ReqDate
  John        High           2012-10-10
  Jack        Low            2012-11-10
  John        NA             2012-10-10
  </code></pre>