Not easy to explain what I'm looking for, so please sorry if I'm not so short.
Having many variables to be managed in several different combinations, I need to automate the assignment of preset values for those variables. So, I have some saved preset data to be assigned to variables but because this is very frequent in my source code, I want to make it automatically, without to name variables in each piece of code. So I would use a variable to keep the whole list of variables. Export is very easy, the problem is for Import. Here is an example:
vars = {"a", "b", "c", "d", "e", "f", "g", "h"};
Export["data.csv", Transpose[{vars, ToExpression[vars]}]]
I have to use the strings to list the variables otherwise the names will be replaced by variables' values before to export. And I have to save also the name of variables because files have to be exported to other software and be human readable. So the problem is when I have to import back the saved data. Normally I should write
{a, b, c, d, e, f, g, h} = Import["data.csv"][[All, 2]]
but (here is the problem) I would write
ToEpxression[vars] = Import["data.csv"][[All, 2]]
so to have assignments in just one line and without naming all variables in each piece of code. Of course, ToExpression[vars] doesn't work because it automatically replaces variables names with their values. So, my question: Is there a combination of Hold, Unevaluated, Defer, or similar constructs so to automatically create the list $\{a, b, c, d, e\}$ (unevaluated) as left-hand site of the Set statement.
Sorry for not being more clear and thanks in advance.
DumpSaveorSavein order to get them back easily. – Kuba Dec 10 '13 at 20:26