title: How do I apply this?
body: <p>I would like to use as the variable for my code below, instead of what comes after ClassName= in 1.txt, I would like what comes in-between this:</p>
  
  <p>EntryText=Ship sunk!|Grid AO 77|<strong>Variable</strong>, </p>
  
  <p>(notice the comma after the variable and the | before it )</p>
  
  <p>So grab after the text line ending with the second | and before the comma.</p>
  
  <p>The text line before the variable will be the same and constant EXCEPT after "Grid" there could be any mixture of letters and numbers up until the second |</p>
  
  <p>So I am trying to use as a variable, what is in between:</p>
  
  <p>EntryText=Ship sunk!|Grid <em>(Any combination of letters or numbers)</em> | <strong>(variable)</strong> , <em>(comma)</em> </p>
  
  <p>So grab in between the second | and the comma. Than you.
   I would like to replace the grabbing of the variable after ClassName= to what is in between the second | and the comma. 
  Please keep in mind that there are other | and commas in the file that I don't want to grab, I just want to grab the variable after | and before comma if its after the "EntryText=Ship sunk!|Grid ....</p>
  
  <p>Again, I don't want the Grid part, I'd like what comes after the second  | and before the comma. There will be many EntryText lines as well, so I'd like to grab that part of all of them and put in my code.</p>
  
  <p>So instead of what is after ClassName=, I'd like to copy what is where the variable listed above.</p>
  
  <p>Thank  you for your time!!</p>
  
  <pre><code>@echo off
  
  copy 2.txt 2.txt-backup
  
  setlocal enableDelayedExpansion
  
  &gt;2.txt (
  for /f "tokens=1* delims=:" %%A in ('findstr /n "^" 2.txt-backup') do (
  ( echo !ln!| findstr "^Type=206$" &gt;NUL &amp;&amp; set ln=ln ) || (
      set "ln=%%B"
      if "!ln:~0,6!"=="Class=" (
          findstr /c:"ClassName=!ln:~6!" "E:\Dropbox\New folder\Log_*.txt" &gt;"E:\Dropbox\New folder\null" &amp;&amp; (
              echo Class=ShipDummy
              set "ln=Type=206"
          )
      )
      if #!ln!==# (echo;) else echo !ln!
  )
  )
  )
  </code></pre>
  
  <p>I was given this bottom code by someone, but I don't know if its what I want or how to apply it to the above:</p>
  
  <pre><code>for /f "tokens=3 delims=|" %%C in ("%%B") do for /f "tokens=1 delims=," %%D in ("%%C") do echo %%D
  </code></pre>
  
  <p>Thank you!!!!!</p>