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; | |
| } |
Author
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
.molfile to.carfile.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
.molfiles inD:\scripts\mol\and create a new directory ofD:\scripts\car. Of course you can customize your own path.Use
Tools -> Scripting -> Debugor pressF5to run this cripts.Find your
.carfiles in new directory created (The default isD:\scripts\car)