title: how to import data from text file without any delimiter or separator?
body: <p>I have to do a task of importing data to mysql from a text file using php code, yeah it's sound so easy, and I have already done that before like importing data from csv file, from excel file or any text file where data is separated with any delimiter. But in my current case, there is no any delimiter just two spaces and the fix length of field. For example-</p>
  
  <pre><code>table field
  |------|-----------|-----------|-------------|
  | id(8)| name(50)  | state(15) | category(10)| 
  |------|-----------|-----------|-------------|
  |      |           |           |             | 
  </code></pre>
  
  <p>sample data of upload.txt file-</p>
  
  <p>::format::</p>
  
  <p>ID  NAME ADDRESS CATEGORY</p>
  
  <pre class="lang-none prettyprint-override"><code>10719922  Union Bank of India                                 delhi            normal      
  10719956  State Bank of India                                 mumbai           normal      
  10719522  HDFC Bank                                           gujrat           high        
  10759924  ICICI Bank                                          goa              normal      
  </code></pre>
  
  <p>Now you can understand the data format of text file, i.e. field length + two spaces, field length + two spaces and so on. The problem is if the data is not matches with the field size then again spaces are hare to complete the length of field that's why two space are not available as delimiter. Like take the first of data- id have 8 digit data than two spaces and name length 50 but data have only 19 character so there is 31 spaces to complete the length 50 after that two space then next field. So I have no delimiter or syntax (rather than length + 2 spaces) to identify the single field data. I am very confused how to import this data to MySQL using php script. does any one think It can be happen. Please I need some idea or php code, to handle this situation. Thank You </p>