본문으로 바로가기

def getMax(filename):
   

### Get the column value of the file

# f=open('d:\\workspace\\run_s2_d.frf')
    f=open(filename)
    f.readline()
    allData=f.readlines()
    f.close()
    countLines=len(allData)
    rowData=[]
    magX_str=[]
    magX=[]
    for i in range(0,countLines-1):
        rowData.append(allData[i].rsplit())
        magX_str.append(rowData[i][2])
        magX.append(float(magX_str[i]))
# print(magX)
    maxMagX=max(magX)
# print(maxMagX)
    return maxMagX

M1=getMax('d:\\workspace\\run_s2_d.frf')
print(M1)