> However, I can see that since you want to import hundreds of
series, "join"
> is not going to be very convenient.
Heh. I beg to differ :)
Here's an alternative implementation which uses "join". Evaluating the
relative merits of the two solutions is left as an exercise to the reader.
Thanks. This is more concise (and in some points more general - the rest I changed), but
the join command does not work...? The problem seems to be that
<hansl>
cmd = sprintf(" %s %s --ikey=ABMAT_ConfigID\n", fname, v)
</hansl>
Does somehow not parse "v" to cmd. If I print cmd, the content of "v"
is missing. If I only print v, it is fine. Is there a maximum string length or such?
Best
Frederik
<hansl>
set verbose off
clear
#string path_base = "E:/RESULTS/ElFarol/Original/"
string path_base = ""
string path_ts = path_base ~ "parameters_"
string ts_name = ".tsv"
scalar first = 1
scalar last = 2 #1600
string temp_path = ""
sprintf temp_path "%s%d%s",path_ts,first,ts_name open @temp_path --
preserve --quiet
loop i=first+1 .. last
fname = sprintf("%s%d%s",path_ts,i,ts_name)
append @fname --quiet
endloop
strings intervals =
defarray("0-499","500-999","1000-1499",\
"1500-1999","1500-1504","1500-1519","1500-1549",\
"1500-1519","1500-1749")
scalar n = nelem(intervals)
loop i=1..n --quiet
fname =
sprintf("%s%s%s%s",path_base,"stat_",intervals[i],"_1.tsv")
content = readfile(fname)
v = ""
getline(content, v)
strings vars = strsplit(v)
v = ""
loop j = 2..nelem(vars) --quiet
v ~= sprintf("%s ",fixname(vars[j]))
endloop
loop j = first .. last --quiet
fname =
sprintf("%s%s%s_%d.tsv",path_base,"stat_",intervals[i], j)
cmd = sprintf(" %s %s --ikey=ABMAT_ConfigID\n", fname, v)
join @cmd
printf "%d, %d\n", i,j
flush
endloop
endloop
varlist
print ABMAT_ConfigID se_Seed sh_Seed MA_Utility_MAE_uq_I9 -o
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------