Welcome To Support Community

Materials Studio

Advanced Search
Ask Search:
rshirshi 

Can I output some results into new file?

Dear all,
        After a simple calculation, we can use "printf ("Test points : %.3f\n", $value)" to print the result value. Can  I output the value into a new file (for example file.txt)? How to write the script in Materials studio?  Any help is appreciated.
       Thank you.

 
Best Answer chosen by rshi
CarstenCarsten (Accelrys) 
This would be something like this:
#!perl

use strict;
use Getopt::Long;
use MaterialsScript qw(:all);

my $TXTFILE = Documents->New("o.txt");


for(my $i = 0; $i < 20; $i++) {
   my $value = $i/3;
    $TXTFILE->Append(sprintf "Test points : %.3f\n", $value);
    }
$TXTFILE->Close;