title: R read data from a txt space delimited file with quoted text
body: <p>I'm trying to load a dataset into R Studio, where the dataset itself is space-delimited, but it also contains spaces in quoted text like in csv files. Here is the <code>head</code> of the data:</p>
  <pre><code>DOC_ID  LABEL   RATING  VERIFIED_PURCHASE   PRODUCT_CATEGORY    PRODUCT_ID  PRODUCT_TITLE   REVIEW_TITLE    REVIEW_TEXT
  1   __label1__  4   N   PC  B00008NG7N  &quot;Targus PAUK10U Ultra Mini USB Keypad, Black&quot;   useful  &quot;When least you think so, this product will save the day. Just keep it around just in case you need it for something.&quot;
  2   __label1__  4   Y   Wireless    B00LH0Y3NM  Note 3 Battery : Stalion Strength Replacement 3200mAh Li-Ion Battery for Samsung Galaxy Note 3 [24-Month Warranty] with NFC Chip + Google Wallet Capable    New era for batteries   Lithium batteries are something new introduced in the market there average developing cost is relatively high but Stallion doesn't compromise on quality and provides us with the best at a low cost.&lt;br /&gt;There are so many in built technical assistants that act like a sensor in their particular forté. The battery keeps my phone charged up and it works at every voltage and a high voltage is never risked.
  3   __label1__  3   N   Baby    B000I5UZ1Q  &quot;Fisher-Price Papasan Cradle Swing, Starlight&quot;  doesn't swing very well.    &quot;I purchased this swing for my baby. She is 6 months now and has pretty much out grown it. It is very loud and doesn't swing very well. It is beautiful though. I love the colors and it has a lot of settings, but I don't think it was worth the money.&quot;
  4   __label1__  4   N   Office Products B003822IRA  Casio MS-80B Standard Function Desktop Calculator   Great computing!    I was looking for an inexpensive desk calcolatur and here it is. It works and does everything I need. Only issue is that it tilts slightly to one side so when I hit any keys it rocks a little bit. Not a big deal.
  5   __label1__  4   N   Beauty  B00PWSAXAM  Shine Whitening - Zero Peroxide Teeth Whitening System - No Sensitivity Only use twice a week   &quot;I only use it twice a week and the results are great. I have used other teeth whitening solutions and most of them, for the same results I would have to use it at least three times a week. Will keep using this because of the potency of the solution and also the technique of the trays, it keeps everything in my teeth, in my mouth.&quot;
  6   __label1__  3   N   Health &amp; Personal Care  B00686HNUK  Tobacco Pipe Stand - Fold-away Portable - Light Weight - For Single Pipe    not sure    I'm not sure what this is supposed to be but I would recommend that you do a little more research into the culture of using pipes if you plan on giving this as a gift or using it yourself.
  7   __label1__  4   N   Toys    B00NUG865W  ESPN 2-Piece Table Tennis   PING PONG TABLE GREAT FOR YOUTHS AND FAMILY &quot;Pleased with ping pong table. 11 year old and 13 year old having a blast, plus lots of family entertainment too. Plus better than kids sitting on video games all day. A friend put it together. I do believe that was a challenge, but nothing they could not handle&quot;
  8   __label1__  4   Y   Beauty  B00QUL8VX6  &quot;Abundant Health 25% Vitamin C Serum with Vitamin E and Hyaluronic Acid for Youthful Looking Skin, 1 fl. oz.&quot;   Great vitamin C serum   &quot;Great vitamin C serum... I really like the oil feeling, not too sticky. I used it last week on some of my recent bug bites and it helps heal the skin faster than normal.&quot;
  9   __label1__  4   N   Health &amp; Personal Care  B004YHKVCM  PODS Spring Meadow HE Turbo Laundry Detergent Pacs 77-load Tub  wonderful detergent.    &quot;I've used tide pods laundry detergent for many years,its such a great detergent to use having a nice scent and leaver the cloths smelling fresh.&quot;
  </code></pre>
  <p>Problem is that it looks tab-delimited but it is not, example would be <code>DOC_ID</code> = 1, where there are only two spaces between <code>useful</code> and <code>&quot;When least...&quot;</code>, this way passing <code>sep = &quot;/t&quot;</code> to <code>read.table</code> throws an error saying that <code>line 1 did not have 10 elements</code>, which for some reason is incorrect, because the number of elements should be 9. Here are the parameters that I'm passing(without the original path):</p>
  <p><code>read.table(file = &quot;path&quot;, sep =&quot;\t&quot;, header = TRUE, strip.white = TRUE)</code></p>
  <p>Also relying on quotes is not a good strategy, because some lines do not have their text quoted, so the delimiter should be something like a double space, which combined with <code>strip.white</code> should work properly, but <code>read.table</code> only accepts single byte delimiters.</p>
  <p>So the question is how would you parse such corpus in R or with any other third party software that could convert it adequately to a csv or atleast a tab-delimited file?</p>