title: Insert spaces in particular places on particular lines in .txt file
body: <p>I've been trying to write a program that opens a text file and inserts spaces after the <em>5th, 6th and 7th</em> word for every line beginning with <code>C_PIN</code>.</p>
  
  <p>I feel that I have it almost complete but I've benn getting run-time errors 5 and 438.</p>
  
  <p>Example text being read:</p>
  
  <hr>
  
  <blockquote>
    <p>COMP C48 66250110810 cap sc_cap.0603_H9  43.3959 74.3331 1   0<br>
    C_PROP (PB_FREE,"Y") (VALUE,"10nF") (TOLER,"10%") (PART_NAME,"06035C103K4T2A")<br>
    C_PIN C48-1 43.3959 75.0951  1  1  0 sp.0603_H9.1 /N$1567<br>
    C_PIN C48-2 43.3959 73.5711  1  1  0 sp.0603_H9.2 GN</p>
  </blockquote>
  
  <hr>
  
  <p>An extra space is required after the <code>1 1 0</code></p>
  
  <p>Here's where I think the problem in my code lies:</p>
  
  <pre><code>x = " "
  Do While Not EOF(infilenum%)
   Line Input #infilenum%, a$
    If Left$(a$, 5) = "C_PIN" Then
     For Each x In InStr
     'If InStr(strText, " ") Then
       w = w + 1
      'w = strText.Split
       For w = 5 To w = 7
        My.Computer.FileSystem.WriteAllText (infilename$)
        strText = My.Computer.FileSystem.ReadAllText(infilename$).Replace(w, x + w)
        vb.newline
  </code></pre>
  
  <p>Any help is much appreciated!</p>