openmolecules.org

 
Home » DataWarrior » Cheminformatics » Batch conversion of dwar files (DWAR to SDF/CSV)
Re: Batch conversion of dwar files [message #1093 is a reply to message #1091] Thu, 22 October 2020 17:47 Go to previous message
thomas is currently offline  thomas
Messages: 711
Registered: June 2014
Senior Member
Hello,

with the current development patch you can run a macro loop over all files within a given directory. You can also create a new macro from a text macro representation as the following. If you copy the following macro text without any empty lines and select the 'Paste Macro' in the DataWarrior 'Macro' menu, and then select 'Run Macro->convertAllFilesToSDF', then DataWarrior asks you to select a directory and then writes an SD-File from every dwar file it finds in the directory.

(the needed DataWarrior files can be downloaded on the download page after selecting the 'Read and understood' checkbox. Look carefully, the download link is in the fineprint!Wink

<macro name="convertAllFilesToSDF">
<task name="repeatNextTasks">
dir=#ask#
filetype=datawarrior
all=true
</task>
<task name="openFile">
fileName=$FILENAME
</task>
<task name="saveSDFile">
version=v3
idColumn=<idColumn>
structureColumn=Structure
coordinates=2D
fileName=$FILENAME.sdf
</task>
<task name="closeWindow">
</task>
</macro>
 
Read Message
Read Message
Previous Topic: Non-aromatic Het Rings
Next Topic: translation of the idcodes
Goto Forum:
  


Current Time: Fri Nov 01 02:06:04 CET 2024

Total time taken to generate the page: 0.04167 seconds