Last active
March 9, 2022 10:26
-
-
Save chenyuxiang0425/e66ea90c005e70333045da7bdb1bad23 to your computer and use it in GitHub Desktop.
convert *.mol to *.car
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use Getopt::Long; | |
use MaterialsScript qw(:all); | |
my $exportDir="D:\\scripts\\car\\"; | |
my $folderPath = "D:\\scripts\\mol\\"; | |
opendir(THISDIR,$folderPath)or die "bad"; | |
my @allfiles = readdir(THISDIR); | |
foreach my $file (@allfiles) { | |
if ($file eq '.' or $file eq '..') { | |
print($file,"\n"); | |
next;} | |
my $totalpath=$folderPath.$file; | |
print($file,"\n"); | |
my $doc = Documents->Import($totalpath); | |
$doc->Clean; | |
$file=~s/.mol//g; | |
$doc->Export("$exportDir/$file.car"); | |
$doc->Close; | |
$doc->Delete; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is it?
This is a script that uses Material Studio 6.1 to covert
.mol
file to.car
file.What are its requirements?
Material Studio 6.1
How to use it in the command line?
Put this file to a Material Studio project. Put your
.mol
files inD:\scripts\mol\
and create a new directory ofD:\scripts\car
. Of course you can customize your own path.Use
Tools -> Scripting -> Debug
or pressF5
to run this cripts.Find your
.car
files in new directory created (The default isD:\scripts\car
)