Column number as a variable in $Filedata Column(1)$
I have several csv files that I loop through to extract data. Each of them hold similar data but they each store the data in different columns. I know based on the filename which fields will store which data.
I'm using variables (for example: $VolumeDataColumnNumber$) to store the column number of the data I want to extract. I change the value in these variables change depending on the file name. For one file, I want to extract Volume data from the second column, so I put 2 into the variable. For another file, I want to extract Volume data from the third column, so I put 3 into the variable.
So depending on the name of the csv file, I can determine what value to use for $VolumeDataColumnNumber$.
Then when I want to extract the data, I would like to use something like this:
$Filedata Column($VolumeDataColumnNumber$)$
Here I'm putting a variable within another variable... but that doesn't work (not surprising).
It may seem obvious that there are many workarounds that would work... but in my real world task, I have several different columns I am pulling and they are all extracted from the csv and put into an SQL "INSERT" statement to store it into a database... so the workaround would turn into a giant mess... so I'm hoping there is a way use my $VolumeDataColumnNumber$ values and $Filedata Column(#)$.
Thanks for your help!
Tyler
|