Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I have a brute force python script that:

  1. Scans the current working directory for all .out files.
  2. Makes a .csv for each .out file.
  3. Dumps all output channels in plaintext to the .csv file.

Keep in mind, this was for PSS/e 33 and Python 2.7. You can use this as a guide for adapting it to your needs or even specifying specific channel #'s/names:

# out2csv.py
# ---- Start of imports -------------------------------------------------------

import sys
import glob

sys.path.append("C:\Program Files (x86)\dev\psse33r12\PSSBIN")
sys.path.append("C:\Program Files (x86)\dev\psse33r12\PSSPY27")  # dyntools.pyc location

import dyntools

# ---- End of   imports -------------------------------------------------------


# ---- Start of main() --------------------------------------------------------
if __name__ == "__main__":

    # Process filename arguments (if supplied)
    if(len(sys.argv) >= 2):
        out_files = sys.argv[1:]
    else:
        out_files = glob.glob("*.out")


    for ctr, out_file in enumerate(out_files):
        obj = dyntools.CHNF(out_file,
                            outvrsn = 0)

        obj.csvout(outfile = out_file)

        # Progress display
        pc = (ctr + 1.0) / len(out_files) * 100.0
        print'\r[%i %%] |%-20s|' % (pc, '-' * int(pc * 20.0 / 100.0)),
# ---- End of   main() --------------------------------------------------------

I have a brute force python script that:

  1. Scans the current working directory for all .out files.files. Or you can specify the file names.
  2. Makes a .csv for each .out file.
  3. Dumps all output channels in plaintext to the .csv file.

Keep in mind, this was for PSS/e 33 and Python 2.7. You can use this as a guide for adapting it to your needs or even specifying specific channel #'s/names:

# out2csv.py
# ---- Start of imports -------------------------------------------------------

import sys
import glob

sys.path.append("C:\Program Files (x86)\dev\psse33r12\PSSBIN")
sys.path.append("C:\Program Files (x86)\dev\psse33r12\PSSPY27")  # dyntools.pyc location

import dyntools

# ---- End of   imports -------------------------------------------------------


# ---- Start of main() --------------------------------------------------------
if __name__ == "__main__":

    # Process filename arguments (if supplied)
    if(len(sys.argv) >= 2):
        out_files = sys.argv[1:]
    else:
        out_files = glob.glob("*.out")


    for ctr, out_file in enumerate(out_files):
        obj = dyntools.CHNF(out_file,
                            outvrsn = 0)

        obj.csvout(outfile = out_file)

        # Progress display
        pc = (ctr + 1.0) / len(out_files) * 100.0
        print'\r[%i %%] |%-20s|' % (pc, '-' * int(pc * 20.0 / 100.0)),
# ---- End of   main() --------------------------------------------------------