Welcome To Support Community

Materials Studio

Advanced Search
Ask Search:
rshirshi 

How to generate a series study table documents using script

Dear all,
       I want to obtain a series study table documents and these std documents are named as r1_0.std, r1_1.std, r1_2.std, r1_3.std,.......,r1_86.std. How can I write the sentences in the script? I tried to write the following simple sentences but no use. I really appreciate any help. Thank you.
 for (my $i=0, $i<87, ++$i)  {
my $std1 = Documents->New("$i r1.std");
}
Best Answer chosen by rshi
Jason DeJoannisJason DeJoannis
my $std_out = Documents->New("appended.std");
for (my $i=0; $i<10; $i++)
{
    my $std_in = $Documents{"$i.std"};
    for (my $row=0; $row<$std_in->RowCount; $row++)
    {
        $std_out->Cell($row,$i*2) = $std_in->Cell($row,0);
        $std_out->Cell($row,$i*2+1) = $std_in->Cell($row,1);
    }
}
 

All Answers

CarstenCarsten (Accelrys) 
What do you get? Which error do you get?
CarstenCarsten (Accelrys) 
In the for statement the commas have to be replaced by semicolons.
rshirshi
Hi Carsten,
      Thank you. You're right. It should be like this, 
 for (my $i=0; $i<87; ++$i)  {
my $std1 = Documents->New("$i r1.std");
}
I got a series std files with the name 0 r1.std, 1 r1.std, 2 r1.std,.....,86 r1.std.

I have another question "how to append the columns from many study tables to one study table". For example, I want to append the first and second columns from 1.std, 2.std,...,10.std to the first and second columns 11.std. How can I do?  Thank you vey much.
Jason DeJoannisJason DeJoannis
my $std_out = Documents->New("appended.std");
for (my $i=0; $i<10; $i++)
{
    my $std_in = $Documents{"$i.std"};
    for (my $row=0; $row<$std_in->RowCount; $row++)
    {
        $std_out->Cell($row,$i*2) = $std_in->Cell($row,0);
        $std_out->Cell($row,$i*2+1) = $std_in->Cell($row,1);
    }
}
 
This was selected as the best answer