Ask Your Question

How to extract data from an out file, to excel

asked 2018-08-20 21:45:17 -0500

Juan gravatar image

Hi How to extract data from an out file, to excel

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-08-20 22:24:24 -0500

haveityourwa gravatar image

Hey Juan, Hopefully the code below should get you somewhere

import sys
import os

# adjust this location for the relevant version of PSSE
PSSE33BINPATH = r"C:/Program Files (x86)/PTI/PSSEUniversity33/pssbin;C:/Program Files (x86)/PTI/PSSEUniversity33/psslib;"
os.environ['PATH'] = PSSE33BINPATH + ';' + os.environ['PATH']
sys.path.append('C:/Program Files (x86)/PTI/PSSEUniversity33/pssbin')
sys.path.append('C:/Program Files (x86)/PTI/PSSEUniversity33/psslib')
import dyntools

def main():
    signals = []  # will print all signals, else you can indicate them like so   signals = [1,2,4,5]

    outfiles = ['result1.out', 'result2.out']   # create a set of out files(this assumes that
                                                # the files are in the same directory of python script)

    for file_name in outfiles: # loop through outfiles
        excel_file = file_name.split(".out")[0] + "_excel" # This line was added to show that xlsfile can be used to change name or even directory
        dyntools.CHNF(file_name).xlsout(channels=signals, show=False, outfile=file_name, xlsfile=excel_file)

if __name__ == '__main__':
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools


Asked: 2018-08-20 21:45:17 -0500

Seen: 51 times

Last updated: Aug 20