title: How to get a substring of variable size for each row in MySQL?
body: <p>I have a MySQL table with <strong>just</strong> a single text type column with lots of information in the same format, starting with a string like this:</p>
  
  <pre><code>Field1 : 1234
  Field2 : Something
  </code></pre>
  
  <p>The column always starts with <strong>Field1</strong> and <strong>Field2</strong>, but the values after each Field are different for each record.</p>
  
  <p>What I need is to get the just the values of what's after <strong>Field1</strong> and <strong>Field2</strong> (in this case <strong>1234</strong> and <strong>Something</strong>) on a Query, the value after <strong>Field1</strong> is easy because it's always 4 characters long, but the problem is the one after <strong>Field2</strong> because it's size varies for each record, what I have so far is this:</p>
  
  <pre><code>SELECT SELECT substring(substring_index(COLUMN,'Field1 : ',-1),1,4) as Field1_value
  FROM table
  </code></pre>
  
  <p>I know after <strong>Field2</strong>'s value there's a line break, so I'll think of considering the <strong>\n</strong> character to delimit the value I need. </p>
  
  <p>How do I get this substring of variable size for each row?</p>
  
  <p>P.S. Yes the data is horribly structured, I'm not able to change it...</p>