Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

Home | Scripts | Examples | Functions | Recent Updates | Tutorials | Resources | Publications | Consulting | Projects | Contact & Bio |PyJEM| Search

 

Script Cleaner
Function
Script to remove empty white lines from a saved script file.
Version
version:20190717, v1.0
Author
D. R. G. Mitchell
Acknowledgements
-
Comments
Following script development there may be considerable white space in a script file, due to empty white lines, where code has been deleted. Also, if opening scripts displayed in non-monotype fonts, additional lines (double spacing) can also be added. This script will remove such empty lines. Two options are provided - remove all empty lines or remove empty lines but then insert two white lines before a comment and one after. The latter formatting helps break up the code to make it more readable. After opening and cleaning a script file, an option to save it as 'filename cleaned.s' is provided.
System Requirements
Should be compatible with all recent versions of DigitalMicrograph.
Known Issues
-
Supported
Yes
Included Files
Main script file.
Source Code

See attached script file.