Declare either the file or string required.
Make convert_pae_file return the abc output, instead of printing it.

Better concentrate all output in a single funcion (main).
If input is in a file, add a proper ABC header in output file.

Start file with %abc-2.1.