I have some org files that I generated from a program I wrote. My program is not intelligent enough to parse the tables in these files "correctly". For example, one of my org files may look like
#+Title: hello world * section 1 here is an unaligned table |this |is | my | | first| unaligned| table | * section 2 here are two more unaligned tables | this | is |my | |second| unaligned | table| |yet|another| unaligned| |table| to |alter| I'd like to be able to automatically align all the tables in these files from the command line. Thus running such a command on my above file would yield
#+Title: hello world * section 1 here is an unaligned table | this | is | my | | first | unaligned | table | * section 2 here are two more unaligned tables | this | is | my | | second | unaligned | table | | yet | another | unaligned | | table | to | alter | Does such a command exist?
I'm aware that setting org-startup-align-all-tables to t will automatically align every table upon visiting the file but I'd like to align the tables without actually opening the file.