title: MySQL LOAD DATA - Loading a text file with ColumnName=Value format
body: <p>I've started learning SQL over the past few days, but am stuck while attempting to get my data into the table.</p>
  
  <p>The data's stored in a text file with the format:</p>
  
  <pre><code>ColumnName1=SomeInteger
  ColumnName2=SomeInteger
  ColumnName3=SomeString
  ... etc
  </code></pre>
  
  <p>So far I've managed to create a table (which has about 150 Columns, that I'm hoping to split up and group seperately once I know more) by stripping the <code>=SomeValue</code> in Python. Then wrapping the column names with <code>CREATE TABLE</code> in a spreadsheet. A bit messy, but it works for now.</p>
  
  <p>Now I'm stuck at the following point:</p>
  
  <pre><code>LOAD DATA INFILE 'path/to/file.txt'
  INTO TABLE tableName
  COLUMNS TERMINATED BY '\n'
  LINES STARTING BY '=';
  </code></pre>
  
  <p>I'm trying to get SQL to insert the data into the column names specified (incase they're not always in the same order), ignore the equals sign, and use the unique filename as my index.
  I've also tried escaping the equals character with <code>'\='</code>, because the MySQL documentation mentions that everything before the <code>LINES STARTING BY</code> parameter should be ignored. Typing <code>LINES STARTING BY 'ColumnName1='</code> manages to ignore the first instance, but it's not exactly what I want, and doesn't work for the remaining lines.</p>
  
  <p>I'm not averse to reading more documentation or tutorials, if someone could point me in the right direction.</p>
  
  <p>edit: Rows are delimited like so: I've been given about 100,000 ini files. Each of which is named FirstName_LastName.ini (uniqueness is guaranteed), and each row of data is contained within the ini files. I need to bring the archaic method of account storage into the 21st century.
  MySQL's LOAD DATA is rumored to be especially fast for this type of task, which is why I began looking into it as an option. I was just wondering if it's possible to manipulate it to work with data in my format, or if I'm better off putting all 100k files through a parser. I'm still open to suggestions that use SQL if there's any magicians reading this.</p>
  
  <p>p.s: If anyone has better ideas for how to get my data (from this text format) into individual tables, I'd love to hear them too.</p>