Skip to content

Instantly share code, notes, and snippets.

@chenyuxiang0425
Last active March 9, 2022 10:26
Show Gist options
  • Save chenyuxiang0425/e66ea90c005e70333045da7bdb1bad23 to your computer and use it in GitHub Desktop.
Save chenyuxiang0425/e66ea90c005e70333045da7bdb1bad23 to your computer and use it in GitHub Desktop.
convert *.mol to *.car
#!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;
}
@chenyuxiang0425
Copy link
Author

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 in D:\scripts\mol\ and create a new directory of D:\scripts\car. Of course you can customize your own path.
Use Tools -> Scripting -> Debug or press F5 to run this cripts.
Find your .car files in new directory created (The default is D:\scripts\car)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment