I am facing the exact same problem ... I must load several files sequentially in a loop. The input files contain 2 columns. The target table contains 3 columns. For all the records coming from the same file, the third column must be filled in with an ID.

By example :

File 1 contains :

col_1_1,col_2_1
col_1_2,col_2_2

File 2 contains :

col_1_1_B,col_2 _1_B
col_1_2_B,col_2 _2_B...