I am trying to produce a general script that will import my data from excel as a data table, and then stack my columns based on the prefix of the column name. I wish for it to be applied to different datasets (not at the same time - just a general script that could apply for all) each with a different sample numbers (columns), where each data column is listed as: S01 Vol Density (%), S02 Vol Density (%), S03 Vol Density (%) ... Sn Vol Density (where n = any integer).
I am thinking the way to do this is by grouping the columns by the prefix and then stacking the group however I am unsure how to proceed with this.
Hope this made sense - still new to scripting so sorry if my question is not the clearest
N.B. Importing data is not an issue, just the stacking