Parse csv files by their names

HI all

I have multiple csv files with the names

   VAR1\_VAR2\_VAR3_VAR4.csv

All the files have the same structure inside just values change.
I am trying to retrieve data from those files by fixing at each time one or more VAR.
I tried to write a script but I have 2 problems:

2- When I fix one variable (i.e, *_VAR2_VAR3_VAR4.csv ) on when VAR1 have 3 entries how to iterate this variable inside a loop ?

My script is here (My first tentative)

 #!/bin/bash          
      #OLDFIS=$IFS
      #IFS=","
      awk -F "," '
      #-------------------------- Table 1  ----------------------- -------#
 # Header begin    

 BEGIN {

      print"=========================================================="

      printf"%-8s %-8s %-8s %-8s %-8s\n","Network size", "P_Energy", "E_Energy",      
     "All_energy","Latency"

      print"=========================================================="
      }

 # Header end  


     NR==3 {printf "%-20s", $1 } NR==25 {printf "%-20s", $2 }   NR==12 {printf "%-20s", $2 }   
   NR==29 {printf "%-20s", $2 } NR==49 {printf "%-20s", $4 }' /...PATH/ *.csv >test.txt

      #-----------------------------------------------------------------------------#

Output:

======================================================================== 
    Network size       P_Energy           E_Energy           All_energy         Latency             
    =========================================================================
                    0.0402597           0.00767312          0.0479328           0.294311

With this code I have two problems:
1- Even I specify a large number of files I get only one row, should I add a loop?
2-I want to parse a set of files by fixing one variable (VAR1), and use its different value as the first column of my output.

Any ideas please?

To 1.
But probably wanted printf only for the formatted output and forgot to add a \n and the end of your outputline.
And because printf is used in the shell, you kept using it rather than print from awk .

To 2.:
Maybe something like:

for var in VAR1 varA varB varC
do
	./script-parse-csv.sh $var_$VAR2_$VAR3_$VAR4.csv
done

Hope this helps