How to do things|
AI Noob vs. Pro
Free Open Source:Swiss File Knife
a command line
free external tools,
Do you have to cope with hard-to-read source code? One colleague is using 3 spaces per tab, the other 4, and a totally different bracket style... if you have to read through a larger portion of source and like to have it purified first, try Artistic Style.
astyle -hfor detailed instructions. for example,
astyle --style=ansi test1.cpp test2.cpp test3.cppwill reformat the listed files; be aware that they're overwritten, so you better make a backup before.
how to reformat many source files in one command
using the free swiss file knife, you can reformat many source files in one go like this:
sfk run "astyle --style=ansi <$file 2>nul" -to \out\$file . .java -yes
which reformats all .java files in the current directory tree. the "2>nul" is required to get rid of all stderr output, as astyle writes its version info to that stream. example command output:
written: \out\actual\Box.java written: \out\actual\Click0.java written: \out\actual\Click1.java written: \out\actual\Click2.java written: \out\actual\Click3.java written: \out\actual\ColumnOfBoxes.java written: \out\alternative\Box.java written: \out\alternative\Click0.java written: \out\alternative\Click1.java written: \out\alternative\Click2.java written: \out\alternative\Click3.java written: \out\alternative\ColumnOfBoxes.java
to view the resulting files instantly, type
which loads and displays all files from directory tree "\out" in depeche view:
further reading: how to reformat xml files