S
Stefan H.
the first field of my data is the _name_ of the measure.
I need to create from the big file one file per measure containing only
data from that measure. The name of each file must be the same of
measure: ie
bigfile.csv
123 rms 12 132
2312 qrt 12 231
2342 sse 12 231
rms.csv
123 rms 12 132
qrt.csv
2342 sse 12 231
the measure names are changing in name and number, then I cannot code
it. I'd like to do
sub split_measures {
my (%splits);
for (<MYFILE>) {
$splits{[split /;/]->[1]} = '';
}
for (keys %splits) {
open $_, ">$_.csv";
}
for (<MYFILE>) {
print [split /;/;]->1 $_;
}
the error I get is that "strict refs" doesn't permit that. Why? It's
safe to remove that clause? Is there a better way to do that?
Thanks
Stefan
I need to create from the big file one file per measure containing only
data from that measure. The name of each file must be the same of
measure: ie
bigfile.csv
123 rms 12 132
2312 qrt 12 231
2342 sse 12 231
rms.csv
123 rms 12 132
qrt.csv
2342 sse 12 231
the measure names are changing in name and number, then I cannot code
it. I'd like to do
sub split_measures {
my (%splits);
for (<MYFILE>) {
$splits{[split /;/]->[1]} = '';
}
for (keys %splits) {
open $_, ">$_.csv";
}
for (<MYFILE>) {
print [split /;/;]->1 $_;
}
the error I get is that "strict refs" doesn't permit that. Why? It's
safe to remove that clause? Is there a better way to do that?
Thanks
Stefan