title: parse text file with array in java
body: <p>I have to parse a text file with array of string the code bellow work fine I need a support how to get rid of the header of fields ( G1 &amp; G2 &amp; G3)  while parsing the text file .</p>
  <pre><code>   try (Scanner scan = new Scanner(new File(&quot;C:\\Test.txt&quot;))) {               
                 
                   String N=null;
                   
                  while( scan.hasNextLine() )
                  {
                      //scan.skip(Pattern.compile(&quot;G1  G2  G3 &quot;));
                      
                      String[] ary = scan.nextLine().split( &quot;\\s+&quot; );           
                      
                      if( ary.length == 3)
                      {
                          if( ary[0].startsWith( &quot;A-&quot; ) )
                              
                              N = ary[0]; 
  
               System.out.printf( &quot;A-%-5s %5s %5s%n&quot;, N, ary[1], ary[2] ); 
  </code></pre>
  <p>2/  file sample is :</p>
  <pre><code>START
  
  ELEMENT
  
  G1      G2      G3
  A-0     FX      0
          FX      1 
  A-20    FY      0
          FY      1  
    
  </code></pre>
  <p>thanks</p>