title: How to parse CSV and import to MYSQL issue
body: <p>I am really stuck at this moment.. I searched and researched and I did not find anything similar, so maybe what I want is not doable.</p>
  <p>I have a .xls file in this format</p>
  <pre><code>|contact| col1  |col2  |  col3  |
  ---------------------------------
  |name1   | info1 |info2 | info3  |
  |address1|       |      |        |
  |phone1  |       |      |        |
  |        |       |      |        |
  |name2   |       |      |        | 
  |address2| info1 |info2 | info3  |
  |phone2  |       |      |        |
  |        |       |      |        | 
  |name_n  | info1 | info2| info3  |
  |addres_n|       |      |        |
  |phone_n |       |      |        |
  ----------------------------------
  </code></pre>
  <p>So I was thinking about creating a table which will be called contact, and another called info. The table contact will contain id(primary key),name,address and phone as fields. And another table with id (primary key) , name (foreign key), col1,col2 and col3. In such a way that if I want to know the details of the name (in table info ) I could go to the other table and see all the values.</p>
  <p>So I researched about how to import this xls format file and the optimal solution will be convert  the xls file to a csv file delimited by comma.</p>
  <p>Therefore, the code which I was thinking to use is (after converting to csv- delimited by comma) the following:</p>
  <p>But the point is that I just want to to the following:</p>
  <ul>
  <li>&quot;Info&quot; Table :    name1,info1,info2,info3.</li>
  <li>&quot;Contact&quot; Table : name1,address,phone1.</li>
  </ul>
  <p><strong>Related to &quot;Info&quot; Table</strong></p>
  <pre><code>LOAD DATA INFILE '/home/username/myfile.csv' 
  INTO TABLE numbers FIELDS TERMINATED BY ';' 
  LINES STARTING BY '-' TERMINATED BY '\r\n' 
  IGNORE 1 LINES 
  (contact,col1,col2,col3);
  </code></pre>
  <p>It is ok when I'm filling the table because I just have to add a '-' at the beginning of the row which I want to fill into the table (the row which contains a non-empty field.)</p>
  <p><strong>Related to &quot;Contact&quot; table:</strong></p>
  <p>It is being difficult since, if I want to take just the column of contact I will have to add some symbol and then operate. Well, I was thinking in add an '*' (for instance) at the beggining of name1 and another one at the end of phone1 for defining the boundaries of the LINE. But I want to define also the fields, which will be a ';' as well. However, the algorithm of LOAD DATA INFILE takes the empty fields also. And I just want to take the fields which contains something different than &quot;empty string&quot;/&quot;null&quot;/. So the question is if I would be able to say something to avoid the empty string. Because as a I read in the <a href="http://dev.mysql.com/doc/refman/5.1/en/load-data.html" rel="nofollow noreferrer" title="MySQL doc">MySQL DOC</a> this is written:</p>
  <blockquote>
  <p>An empty field value is interpreted different from a missing field:</p>
  <p>For string types, the column is set to the empty string.</p>
  <p>For numeric types, the column is set to 0.</p>
  <p>For date and time types, the column is set to the appropriate “zero” value for &gt;the type. See Section 11.3, “Date and Time Types”.</p>
  </blockquote>
  <p>But it does not say anything about avoid it. (I mean, If is an empty value, then pass the the next field and evaluate again until find a non-empty value)</p>
  <p>I am asking that because with my idea of face it It will fill a row like that :
  Name1,null,null,null,address1,null,null,null,phone1 and so on.</p>
  <p>Any ideas?</p>