title: How to set and use global array variable in Batch file
body: <p>Here is my code for storing the words extracted from a log file into an array, which I want to use in the batch file later on.</p>
  
  <pre><code>cls
  @echo off
  set /a i=0
  TIMEOUT 2
  REM I want to save the words from newlog.txt into an array for later use in batch file.
  SETLOCAL EnableDelayedExpansion
  FOR /F "tokens=1,2,3 delims= " %%G IN (newlog.txt) DO ( set a[%i%]=%%H 
  &amp; set /a i+=1 @echo !a[%i%]! )
  @echo %i%
  @echo a[%i%]
  TIMEOUT 200
  </code></pre>
  
  <p>I just want to use them as global variables.</p>