fName = 'resources_3_24_250_1'
fdIn = open(fName + '.txt', 'r')
fdOut = open(fName + '_thres.txt', 'w')

first = True
atts = []
for line in fdIn:
    tmp = line.split()
    if first == True:
        first = False
        atts = tmp
        fdOut.write(line)
        continue
    newData = []
    for i in range(len(atts)):
        if tmp[i] == 'none': newData.append(tmp[i])
        elif atts[i] == 'nid' or atts[i] == 'time' or atts[i] == 'Loc': newData.append(tmp[i])
        elif atts[i] == 'Lati' or atts[i] == 'Longi': newData.append(round(float(tmp[i]), 1))
        elif atts[i] == 'NType' or atts[i] == 'KVer' or atts[i] == 'FCName': newData.append(tmp[i])
        elif atts[i] == 'CSp': newData.append(round(float(tmp[i]), 1))
        elif atts[i] == 'NCore' or atts[i] == 'CorePC': newData.append(tmp[i])
        elif atts[i] == 'MSize': newData.append(round(float(tmp[i]), 2))
        elif atts[i] == 'DSize': newData.append(round(float(tmp[i]), 1))
        elif atts[i] == 'BWLim' or atts[i] == 'CFree': newData.append(int(round(float(tmp[i]), 0)))
        elif atts[i] == 'DFree': newData.append(round(float(tmp[i]), 1))
        elif atts[i] == 'Tx' or atts[i] == 'Rx' or atts[i] == 'MFree': newData.append(int(round(float(tmp[i]), 0)))
        elif atts[i] == 'RspT': newData.append(round(float(tmp[i]), 2))
        elif atts[i] == 'UpT' or atts[i] == '1mLd' or atts[i] == '5mLd': newData.append(round(float(tmp[i]), 1))
        elif atts[i] == 'TAve': newData.append(round(float(tmp[i]), 1))
        elif atts[i] == 'Drift': newData.append(round(float(tmp[i]), 2))
        elif atts[i] == 'Boot': newData.append(tmp[i])
        else: assert(False), atts[i]
    tmpStr = ''
    for i in newData: tmpStr += str(i) + '\t'
    fdOut.write(tmpStr + '\n')

fdIn.close()
fdOut.close()
