title: Format text file for the LOAD DATA INFILE command
body: <p>I'm working in a company where I have this project to create a web application based on the products my company is making.</p>
  
  <p>There is an inside server which contains all the data from my company. What I have to do is parse the data the oracle server is retrieving. It is retrieving .lst files which can be easily translated to .csv using Excel or some php packages.</p>
  
  <p>I successfully imported the Clients table into my MySQL database using the LOAD DATA INFILE command. But I'm running some issues when I want to parse the Articles table. </p>
  
  <p>The columns/values aren't necessarily separated by semi-colons. To parse the data I'll have to say for example :</p>
  
  <ul>
  <li>The first 6 characters are the Article ID</li>
  <li>The next 35 characters are the description of the article</li>
  </ul>
  
  <p>and so on...</p>
  
  <p>Is there a way I could achieve this when using the LOAD DATA INFILE command, or should I format the file correctly using PHP then use this command and if so what could be the best approach?</p>
  
  <p>Thanks guys, I hope I made myself clear since english isn't my primary language. :P</p>
  
  <p>Edit : those are rows.</p>
  
  <pre><code>51016 51016 BOITE ORANGINA 33cls CASHS   "24"                               040430024000330  0000000000            1       01000000550009000                   000000NNNNNN caisse         0000003750000000000001230      
  51019 51019 BOITE OASIS ORANGE CASHS  "24" 33cl                             040430024000330  0000000000            1       01000000550009000                   000000NNNNNN caisse         0000003670000000000001230
  </code></pre>
  
  <p>The first line is getting parsed correctly while the second isnt.The double quote after 24 is being put into the next column. I just wanted to know if it was possible to do something about it, like deleting the double quotes.      </p>
  
  <p>A previous developer created an application to manage the articles, clients from the company. Unfortunately he cannot help me anymore but here is a ligne that describe a row.</p>
  
  <pre><code>import_a;Code_article;6;designation;35;designation2;35;Code_famille;2;Code_sousfamille;4;unite_condition;3;contenance;6/1000;Champ_vide;2;degre;4/10;champ_vide_6;6;Code_emballage;4;Champ_vide2;8;validite;1;Champ_vide3;7;code_tva;2;taux_tva;9/100;poids;6/1000;champ_vide4;19;montant_droits;6/1000;valide;1;rupture;1;edit_tarif;1;pre_commande;1;gratuit_autorise;1;trans_port;1;Champ_libre;1;caisse;15;prix_revient;9/100;stock;6/1;Champ_vide5;5;code_fournisseur;11/1
  </code></pre>
  
  <p>import_a => It's the filename you can just ignore that.</p>
  
  <p>Then you have the name of the column followed by the number of characters. For example Code_articles is composed of 6 characters and so on.</p>
  
  <p>You can also just ignore the duplicate ID Key at the beginning. <strong>But in total there should be 31 columns.</strong></p>