I have a text file I am trying to manipulate, but the code is very long. I know there is an easy way to do this by looping a few functiions. My code is below but it is not complete. I also have attached one of the text files. There are generally 21 of these files. They are always saved in the same place and follow the format. "mmddyy01" The 01 is the first text file for that day. mmddyy is the date. There are 3 files for each day. This program takes text from the first file and manipulates it to be uploaded to the web. I need to post a value for each hour of each day. The first text file for the day covers 00:00-07:00 the second 07:00-11:00 and the third 11:00 to 24:00. I have to do this for 7 days two times a week. Here is my code so far. Let me know if you have any questions, I am sure I did not explain it correctly, so please ask.
Thanks in advance,
Joe

noline=0
intFCITC_list = [] #Empty list where we will put all values of intFCITC
for line in open('c:\\atc\\11180901.lis'):
    if noline==1:
        fcitc=line[:9].strip()
        intFCITC = round(float(fcitc),1) #OP wants this to be integer.
        intFCITC_list.append(intFCITC)
        limConst=line[29:79].strip()
        noline+=1
    elif noline==2:
        contDesc=line[90:137].strip() #Added subscripts. Don't want entire line.
        noline=0
    if "FCITC" in line:
        noline+=1
OUC2FPL=str(intFCITC_list[0])
OUC2FPC=str(intFCITC_list[1])
OUC2TEC=str(intFCITC_list[2])
OUC2FPL=str(intFCITC_list[3])
#Refer to any element by its index
if intFCITC_list[0]<0:
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 0:00,11/18/2009 1:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 1:00,11/18/2009 2:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 2:00,11/18/2009 3:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 3:00,11/18/2009 4:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 4:00,11/18/2009 5:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 5:00,11/18/2009 6:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 6:00,11/18/2009 7:00')
else:
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 0:00,11/18/2009 1:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 1:00,11/18/2009 2:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 2:00,11/18/2009 3:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 3:00,11/18/2009 4:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 4:00,11/18/2009 5:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 5:00,11/18/2009 6:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 6:00,11/18/2009 7:00')
if intFCITC_list[1]<0:
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 0:00,11/18/2009 1:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 1:00,11/18/2009 2:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 2:00,11/18/2009 3:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 3:00,11/18/2009 4:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 4:00,11/18/2009 5:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 5:00,11/18/2009 6:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 6:00,11/18/2009 7:00')
else:
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 0:00,11/18/2009 1:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 1:00,11/18/2009 2:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 2:00,11/18/2009 3:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 3:00,11/18/2009 4:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 4:00,11/18/2009 5:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 5:00,11/18/2009 6:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 6:00,11/18/2009 7:00')
if intFCITC_list[2]<0:
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 0:00,11/18/2009 1:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 1:00,11/18/2009 2:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 2:00,11/18/2009 3:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 3:00,11/18/2009 4:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 4:00,11/18/2009 5:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 5:00,11/18/2009 6:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 6:00,11/18/2009 7:00')
else:
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 0:00,11/18/2009 1:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 1:00,11/18/2009 2:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 2:00,11/18/2009 3:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 3:00,11/18/2009 4:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 4:00,11/18/2009 5:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 5:00,11/18/2009 6:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 6:00,11/18/2009 7:00')
if intFCITC_list[3]<0:
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 0:00,11/18/2009 1:00')
    f.write ('OUCT,0,,,,,,FLP,OUC,11/18/2009 1:00,11/18/2009 2:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 2:00,11/18/2009 3:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 3:00,11/18/2009 4:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 4:00,11/18/2009 5:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 5:00,11/18/2009 6:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 6:00,11/18/2009 7:00')
else:
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 0:00,11/18/2009 1:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 1:00,11/18/2009 2:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 2:00,11/18/2009 3:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 3:00,11/18/2009 4:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 4:00,11/18/2009 5:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 5:00,11/18/2009 6:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 6:00,11/18/2009 7:00')
if intFCITC_list[4]<0:
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 0:00,11/18/2009 1:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 1:00,11/18/2009 2:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 2:00,11/18/2009 3:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 3:00,11/18/2009 4:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 4:00,11/18/2009 5:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 5:00,11/18/2009 6:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 6:00,11/18/2009 7:00')
else:
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 0:00,11/18/2009 1:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 1:00,11/18/2009 2:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 2:00,11/18/2009 3:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 3:00,11/18/2009 4:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 4:00,11/18/2009 5:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 5:00,11/18/2009 6:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 6:00,11/18/2009 7:00')
if intFCITC_list[5]<0:
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 0:00,11/18/2009 1:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 1:00,11/18/2009 2:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 2:00,11/18/2009 3:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 3:00,11/18/2009 4:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 4:00,11/18/2009 5:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 5:00,11/18/2009 6:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 6:00,11/18/2009 7:00')
else:
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 0:00,11/18/2009 1:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 1:00,11/18/2009 2:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 2:00,11/18/2009 3:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 3:00,11/18/2009 4:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 4:00,11/18/2009 5:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 5:00,11/18/2009 6:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 6:00,11/18/2009 7:00')
if intFCITC_list[6]<0:
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 0:00,11/18/2009 1:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 1:00,11/18/2009 2:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 2:00,11/18/2009 3:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 3:00,11/18/2009 4:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 4:00,11/18/2009 5:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 5:00,11/18/2009 6:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 6:00,11/18/2009 7:00')
else:
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 0:00,11/18/2009 1:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 1:00,11/18/2009 2:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 2:00,11/18/2009 3:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 3:00,11/18/2009 4:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 4:00,11/18/2009 5:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 5:00,11/18/2009 6:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 6:00,11/18/2009 7:00')
if intFCITC_list[7]<0:
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 0:00,11/18/2009 1:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 1:00,11/18/2009 2:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 2:00,11/18/2009 3:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 3:00,11/18/2009 4:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 4:00,11/18/2009 5:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 5:00,11/18/2009 6:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 6:00,11/18/2009 7:00')
else:
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 0:00,11/18/2009 1:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 1:00,11/18/2009 2:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 2:00,11/18/2009 3:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 3:00,11/18/2009 4:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 4:00,11/18/2009 5:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 5:00,11/18/2009 6:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 6:00,11/18/2009 7:00')
if intFCITC_list[8]<0:
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 0:00,11/18/2009 1:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 1:00,11/18/2009 2:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 2:00,11/18/2009 3:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 3:00,11/18/2009 4:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 4:00,11/18/2009 5:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 5:00,11/18/2009 6:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 6:00,11/18/2009 7:00')
else:
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 0:00,11/18/2009 1:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 1:00,11/18/2009 2:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 2:00,11/18/2009 3:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 3:00,11/18/2009 4:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 4:00,11/18/2009 5:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 5:00,11/18/2009 6:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 6:00,11/18/2009 7:00')
if intFCITC_list[9]<0:
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 0:00,11/18/2009 1:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 1:00,11/18/2009 2:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 2:00,11/18/2009 3:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 3:00,11/18/2009 4:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 4:00,11/18/2009 5:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 5:00,11/18/2009 6:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 6:00,11/18/2009 7:00')
else:
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 0:00,11/18/2009 1:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 1:00,11/18/2009 2:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 2:00,11/18/2009 3:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 3:00,11/18/2009 4:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 4:00,11/18/2009 5:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 5:00,11/18/2009 6:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 6:00,11/18/2009 7:00')
for line in open('c:\\atc\\11180902.lis'):
    if noline==1:
        fcitc=line[:9].strip()
        intFCITC = round(float(fcitc),1) #OP wants this to be integer.
        intFCITC_list.append(intFCITC)
        limConst=line[29:79].strip()
        noline+=1
    elif noline==2:
        contDesc=line[90:137].strip() #Added subscripts. Don't want entire line.
        noline=0
    if "FCITC" in line:
        noline+=1
OUC2FPL=str(intFCITC_list[0])
OUC2FPC=str(intFCITC_list[1])
OUC2TEC=str(intFCITC_list[2])
OUC2FPL=str(intFCITC_list[3])
#Refer to any element by its index
if intFCITC_list[0]<0:
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 7:00,11/18/2009 8:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 8:00,11/18/2009 9:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 9:00,11/18/2009 10:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 10:00,11/18/2009 11:00')
else:
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 7:00,11/18/2009 8:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 8:00,11/18/2009 9:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 9:00,11/18/2009 10:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 10:00,11/18/2009 11:00')
if intFCITC_list[1]<0:
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 7:00,11/18/2009 8:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 8:00,11/18/2009 9:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 9:00,11/18/2009 10:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 10:00,11/18/2009 11:00')
else:
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 7:00,11/18/2009 8:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 8:00,11/18/2009 9:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 9:00,11/18/2009 10:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 10:00,11/18/2009 11:00')
if intFCITC_list[2]<0:
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 7:00,11/18/2009 8:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 8:00,11/18/2009 9:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 9:00,11/18/2009 10:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 10:00,11/18/2009 11:00')
else:
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 7:00,11/18/2009 8:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 8:00,11/18/2009 9:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 9:00,11/18/2009 10:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 10:00,11/18/2009 11:00')
if intFCITC_list[3]<0:
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 7:00,11/18/2009 8:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 8:00,11/18/2009 9:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 9:00,11/18/2009 10:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 10:00,11/18/2009 11:00')
else:
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 7:00,11/18/2009 8:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 8:00,11/18/2009 9:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 9:00,11/18/200910:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 10:00,11/18/2009 11:00')
if intFCITC_list[4]<0:
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 7:00,11/18/2009 8:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 8:00,11/18/2009 9:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 9:00,11/18/2009 10:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 10:00,11/18/2009 11:00')
else:
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 7:00,11/18/2009 8:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 8:00,11/18/2009 9:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 9:00,11/18/2009 10:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 10:00,11/18/2009 11:00')
if intFCITC_list[5]<0:
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 7:00,11/18/2009 8:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 8:00,11/18/2009 9:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 9:00,11/18/2009 10:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 10:00,11/18/2009 11:00')
else:
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 7:00,11/18/2009 8:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 8:00,11/18/2009 9:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 9:00,11/18/2009 10:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 10:00,11/18/2009 11:00')
if intFCITC_list[6]<0:
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 7:00,11/18/2009 8:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 8:00,11/18/2009 9:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 9:00,11/18/2009 10:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 10:00,11/18/2009 11:00')
else:
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 7:00,11/18/2009 8:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 8:00,11/18/2009 9:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 9:00,11/18/2009 10:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 10:00,11/18/2009 11:00')
if intFCITC_list[7]<0:
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 7:00,11/18/2009 8:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 8:00,11/18/2009 9:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 9:00,11/18/2009 10:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 10:00,11/18/2009 11:00')
else:
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 7:00,11/18/2009 8:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 8:00,11/18/2009 9:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 9:00,11/18/200910:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 10:00,11/18/2009 11:00')
if intFCITC_list[8]<0:
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 7:00,11/18/2009 8:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 8:00,11/18/2009 9:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 9:00,11/18/2009 10:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 10:00,11/18/2009 11:00')
else:
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 7:00,11/18/2009 8:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 8:00,11/18/2009 9:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 9:00,11/18/2009 10:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 10:00,11/18/2009 11:00')
if intFCITC_list[9]<0:
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 7:00,11/18/2009 8:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 8:00,11/18/2009 9:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 9:00,11/18/2009 10:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 10:00,11/18/2009 11:00')
else:
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 7:00,11/18/2009 8:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 8:00,11/18/2009 9:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 9:00,11/18/2009 10:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 10:00,11/18/2009 11:00')
for line in open('c:\\atc\\11180903.lis'):
    if noline==1:
        fcitc=line[:9].strip()
        intFCITC = round(float(fcitc),1) #OP wants this to be integer.
        intFCITC_list.append(intFCITC)
        limConst=line[29:79].strip()
        noline+=1
    elif noline==2:
        contDesc=line[90:137].strip() #Added subscripts. Don't want entire line.
        noline=0
    if "FCITC" in line:
        noline+=1
OUC2FPL=str(intFCITC_list[0])
OUC2FPC=str(intFCITC_list[1])
OUC2TEC=str(intFCITC_list[2])
OUC2FPL=str(intFCITC_list[3])
#Refer to any element by its index
if intFCITC_list[0]<0:
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 23:00,11/19/2009 00:00')
if intFCITC_list[1]<0:
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 23:00,11/19/2009 00:00')
if intFCITC_list[2]<0:
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 23:00,11/19/2009 00:00')
if intFCITC_list[3]<0:
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/18/2009 23:00,11/19/2009 00:00')
if intFCITC_list[4]<0:
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/18/2009 23:00,11/19/2009 00:00')
if intFCITC_list[5]<0:
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/18/2009 23:00,11/19/2009 00:00')
if intFCITC_list[6]<0:
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/18/2009 23:00,11/19/2009 00:00')
if intFCITC_list[7]<0:
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/18/2009 23:00,11/19/2009 00:00')
if intFCITC_list[8]<0:
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/18/2009 23:00,11/19/2009 00:00')
if intFCITC_list[9]<0:
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/18/2009 23:00,11/19/2009 00:00')
if intFCITC_list[10]<0:
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 11:00,11/18/2009 12:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 12:00,11/18/2009 13:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 13:00,11/18/2009 14:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 14:00,11/18/2009 15:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 15:00,11/18/2009 16:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 16:00,11/18/2009 17:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 17:00,11/18/2009 18:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 18:00,11/18/2009 19:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 19:00,11/18/2009 20:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 20:00,11/18/2009 21:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 21:00,11/18/2009 22:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 22:00,11/18/2009 23:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/18/2009 23:00,11/19/2009 00:00')
else:
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 11:00,11/18/2009 12:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 12:00,11/18/2009 13:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 13:00,11/18/2009 14:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 14:00,11/18/2009 15:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 15:00,11/18/2009 16:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 16:00,11/18/2009 17:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 17:00,11/18/2009 18:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 18:00,11/18/2009 19:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 19:00,11/18/2009 20:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 20:00,11/18/2009 21:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 21:00,11/18/2009 22:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 22:00,11/18/2009 23:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/18/2009 23:00,11/19/2009 00:00')
noline=0
intFCITC_list = [] #Empty list where we will put all values of intFCITC
for line in open('c:\\atc\\11190901.lis'):
    if noline==1:
        fcitc=line[:9].strip()
        intFCITC = round(float(fcitc),1) #OP wants this to be integer.
        intFCITC_list.append(intFCITC)
        limConst=line[29:79].strip()
        noline+=1
    elif noline==2:
        contDesc=line[90:137].strip() #Added subscripts. Don't want entire line.
        noline=0
    if "FCITC" in line:
        noline+=1
OUC2FPL=str(intFCITC_list[0])
OUC2FPC=str(intFCITC_list[1])
OUC2TEC=str(intFCITC_list[2])
OUC2FPL=str(intFCITC_list[3])
#Refer to any element by its index
if intFCITC_list[0]<0:
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 0:00,11/19/2009 1:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 1:00,11/19/2009 2:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 2:00,11/19/2009 3:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 3:00,11/19/2009 4:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 4:00,11/19/2009 5:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 5:00,11/19/2009 6:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 6:00,11/19/2009 7:00')
else:
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 0:00,11/19/2009 1:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 1:00,11/19/2009 2:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 2:00,11/19/2009 3:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 3:00,11/19/2009 4:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 4:00,11/19/2009 5:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 5:00,11/19/2009 6:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 6:00,11/19/2009 7:00')
if intFCITC_list[1]<0:
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 0:00,11/19/2009 1:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 1:00,11/19/2009 2:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 2:00,11/19/2009 3:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 3:00,11/19/2009 4:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 4:00,11/19/2009 5:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 5:00,11/19/2009 6:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 6:00,11/19/2009 7:00')
else:
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 0:00,11/19/2009 1:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 1:00,11/19/2009 2:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 2:00,11/19/2009 3:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 3:00,11/19/2009 4:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 4:00,11/19/2009 5:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 5:00,11/19/2009 6:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 6:00,11/19/2009 7:00')
if intFCITC_list[2]<0:
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 0:00,11/19/2009 1:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 1:00,11/19/2009 2:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 2:00,11/19/2009 3:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 3:00,11/19/2009 4:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 4:00,11/19/2009 5:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 5:00,11/19/2009 6:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 6:00,11/19/2009 7:00')
else:
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 0:00,11/19/2009 1:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 1:00,11/19/2009 2:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 2:00,11/19/2009 3:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 3:00,11/19/2009 4:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 4:00,11/19/2009 5:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 5:00,11/19/2009 6:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 6:00,11/19/2009 7:00')
if intFCITC_list[3]<0:
    f.write ('OUCT,0,,,,,,FPL,OUC,11/19/2009 0:00,11/19/2009 1:00')
    f.write ('OUCT,0,,,,,,FLP,OUC,11/19/2009 1:00,11/19/2009 2:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/19/2009 2:00,11/19/2009 3:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/19/2009 3:00,11/19/2009 4:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/19/2009 4:00,11/19/2009 5:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/19/2009 5:00,11/19/2009 6:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/19/2009 6:00,11/19/2009 7:00')
else:
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 0:00,11/19/2009 1:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 1:00,11/19/2009 2:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 2:00,11/19/2009 3:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 3:00,11/19/2009 4:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 4:00,11/19/2009 5:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 5:00,11/19/2009 6:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 6:00,11/19/2009 7:00')
if intFCITC_list[4]<0:
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 0:00,11/19/2009 1:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 1:00,11/19/2009 2:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 2:00,11/19/2009 3:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 3:00,11/19/2009 4:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 4:00,11/19/2009 5:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 5:00,11/19/2009 6:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 6:00,11/19/2009 7:00')
else:
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 0:00,11/19/2009 1:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 1:00,11/19/2009 2:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 2:00,11/19/2009 3:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 3:00,11/19/2009 4:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 4:00,11/19/2009 5:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 5:00,11/19/2009 6:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 6:00,11/19/2009 7:00')
if intFCITC_list[5]<0:
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 0:00,11/19/2009 1:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 1:00,11/19/2009 2:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 2:00,11/19/2009 3:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 3:00,11/19/2009 4:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 4:00,11/19/2009 5:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 5:00,11/19/2009 6:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 6:00,11/19/2009 7:00')
else:
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 0:00,11/19/2009 1:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 1:00,11/19/2009 2:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 2:00,11/19/2009 3:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 3:00,11/19/2009 4:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 4:00,11/19/2009 5:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 5:00,11/19/2009 6:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 6:00,11/19/2009 7:00')
if intFCITC_list[6]<0:
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 0:00,11/19/2009 1:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 1:00,11/19/2009 2:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 2:00,11/19/2009 3:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 3:00,11/19/2009 4:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 4:00,11/19/2009 5:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 5:00,11/19/2009 6:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 6:00,11/19/2009 7:00')
else:
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 0:00,11/19/2009 1:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 1:00,11/19/2009 2:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 2:00,11/19/2009 3:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 3:00,11/19/2009 4:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 4:00,11/19/2009 5:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 5:00,11/19/2009 6:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 6:00,11/19/2009 7:00')
if intFCITC_list[7]<0:
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 0:00,11/19/2009 1:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 1:00,11/19/2009 2:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 2:00,11/19/2009 3:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 3:00,11/19/2009 4:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 4:00,11/19/2009 5:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 5:00,11/19/2009 6:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 6:00,11/19/2009 7:00')
else:
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 0:00,11/19/2009 1:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 1:00,11/19/2009 2:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 2:00,11/19/2009 3:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 3:00,11/19/2009 4:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 4:00,11/19/2009 5:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 5:00,11/19/2009 6:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 6:00,11/19/2009 7:00')
if intFCITC_list[8]<0:
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 0:00,11/19/2009 1:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 1:00,11/19/2009 2:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 2:00,11/19/2009 3:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 3:00,11/19/2009 4:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 4:00,11/19/2009 5:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 5:00,11/19/2009 6:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 6:00,11/19/2009 7:00')
else:
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 0:00,11/19/2009 1:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 1:00,11/19/2009 2:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 2:00,11/19/2009 3:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 3:00,11/19/2009 4:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 4:00,11/19/2009 5:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 5:00,11/19/2009 6:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 6:00,11/19/2009 7:00')
if intFCITC_list[9]<0:
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 0:00,11/19/2009 1:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 1:00,11/19/2009 2:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 2:00,11/19/2009 3:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 3:00,11/19/2009 4:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 4:00,11/19/2009 5:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 5:00,11/19/2009 6:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 6:00,11/19/2009 7:00')
else:
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 0:00,11/19/2009 1:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 1:00,11/19/2009 2:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 2:00,11/19/2009 3:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 3:00,11/19/2009 4:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 4:00,11/19/2009 5:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 5:00,11/19/2009 6:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 6:00,11/19/2009 7:00')
for line in open('c:\\atc\\11190902.lis'):
    if noline==1:
        fcitc=line[:9].strip()
        intFCITC = round(float(fcitc),1) #OP wants this to be integer.
        intFCITC_list.append(intFCITC)
        limConst=line[29:79].strip()
        noline+=1
    elif noline==2:
        contDesc=line[90:137].strip() #Added subscripts. Don't want entire line.
        noline=0
    if "FCITC" in line:
        noline+=1
OUC2FPL=str(intFCITC_list[0])
OUC2FPC=str(intFCITC_list[1])
OUC2TEC=str(intFCITC_list[2])
OUC2FPL=str(intFCITC_list[3])
#Refer to any element by its index
if intFCITC_list[0]<0:
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 7:00,11/19/2009 8:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 8:00,11/19/2009 9:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 9:00,11/19/2009 10:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 10:00,11/19/2009 11:00')
else:
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 7:00,11/19/2009 8:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 8:00,11/19/2009 9:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 9:00,11/19/2009 10:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 10:00,11/19/2009 11:00')
if intFCITC_list[1]<0:
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 7:00,11/19/2009 8:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 8:00,11/19/2009 9:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 9:00,11/19/2009 10:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 10:00,11/19/2009 11:00')
else:
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 7:00,11/19/2009 8:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 8:00,11/19/2009 9:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 9:00,11/19/2009 10:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 10:00,11/19/2009 11:00')
if intFCITC_list[2]<0:
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 7:00,11/19/2009 8:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 8:00,11/19/2009 9:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 9:00,11/19/2009 10:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 10:00,11/19/2009 11:00')
else:
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 7:00,11/19/2009 8:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 8:00,11/19/2009 9:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 9:00,11/19/2009 10:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 10:00,11/19/2009 11:00')
if intFCITC_list[3]<0:
    f.write ('OUCT,0,,,,,,FPL,OUC,11/19/2009 7:00,11/19/2009 8:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/19/2009 8:00,11/19/2009 9:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/19/2009 9:00,11/19/2009 10:00')
    f.write ('OUCT,0,,,,,,FPL,OUC,11/19/2009 10:00,11/19/2009 11:00')
else:
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 7:00,11/19/2009 8:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 8:00,11/19/2009 9:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 9:00,11/19/200910:00')
    f.write('OUCT,+FPL2OUC+,,,,,,,FPL,OUC,11/19/2009 10:00,11/19/2009 11:00')
if intFCITC_list[4]<0:
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 7:00,11/19/2009 8:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 8:00,11/19/2009 9:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 9:00,11/19/2009 10:00')
    f.write ('OUCT,0,,,,,,FPC,OUC,11/19/2009 10:00,11/19/2009 11:00')
else:
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 7:00,11/19/2009 8:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 8:00,11/19/2009 9:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 9:00,11/19/2009 10:00')
    f.write('OUCT,+FPC2OUC+,,,,,,,FPC,OUC,11/19/2009 10:00,11/19/2009 11:00')
if intFCITC_list[5]<0:
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 7:00,11/19/2009 8:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 8:00,11/19/2009 9:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 9:00,11/19/2009 10:00')
    f.write ('OUCT,0,,,,,,TEC,OUC,11/19/2009 10:00,11/19/2009 11:00')
else:
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 7:00,11/19/2009 8:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 8:00,11/19/2009 9:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 9:00,11/19/2009 10:00')
    f.write('OUCT,+TEC2OUC+,,,,,,,TEC,OUC,11/19/2009 10:00,11/19/2009 11:00')
if intFCITC_list[6]<0:
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 7:00,11/19/2009 8:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 8:00,11/19/2009 9:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 9:00,11/19/2009 10:00')
    f.write ('OUCT,0,,,,,,RRI,OUC,11/19/2009 10:00,11/19/2009 11:00')
else:
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 7:00,11/19/2009 8:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 8:00,11/19/2009 9:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 9:00,11/19/2009 10:00')
    f.write('OUCT,+RRI2OUC+,,,,,,,RRI,OUC,11/19/2009 10:00,11/19/2009 11:00')
if intFCITC_list[7]<0:
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 7:00,11/19/2009 8:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 8:00,11/19/2009 9:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 9:00,11/19/2009 10:00')
    f.write ('OUCT,0,,,,,,RRI,FPL,11/19/2009 10:00,11/19/2009 11:00')
else:
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 7:00,11/19/2009 8:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 8:00,11/19/2009 9:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 9:00,11/19/200910:00')
    f.write('OUCT,+RRI2FPL+,,,,,,,RRI,FPL,11/19/2009 10:00,11/19/2009 11:00')
if intFCITC_list[8]<0:
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 7:00,11/19/2009 8:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 8:00,11/19/2009 9:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 9:00,11/19/2009 10:00')
    f.write ('OUCT,0,,,,,,RRI,FPC,11/19/2009 10:00,11/19/2009 11:00')
else:
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 7:00,11/19/2009 8:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 8:00,11/19/2009 9:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 9:00,11/19/2009 10:00')
    f.write('OUCT,+RRI2FPC+,,,,,,,RRI,FPC,11/19/2009 10:00,11/19/2009 11:00')
if intFCITC_list[9]<0:
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 7:00,11/19/2009 8:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 8:00,11/19/2009 9:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 9:00,11/19/2009 10:00')
    f.write ('OUCT,0,,,,,,RRI,TEC,11/19/2009 10:00,11/19/2009 11:00')
else:
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 7:00,11/19/2009 8:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 8:00,11/19/2009 9:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 9:00,11/19/2009 10:00')
    f.write('OUCT,+RRI2TEC+,,,,,,,RRI,TEC,11/19/2009 10:00,11/19/2009 11:00')
for line in open('c:\\atc\\11190903.lis'):
    if noline==1:
        fcitc=line[:9].strip()
        intFCITC = round(float(fcitc),1) #OP wants this to be integer.
        intFCITC_list.append(intFCITC)
        limConst=line[29:79].strip()
        noline+=1
    elif noline==2:
        contDesc=line[90:137].strip() #Added subscripts. Don't want entire line.
        noline=0
    if "FCITC" in line:
        noline+=1
OUC2FPL=str(intFCITC_list[0])
OUC2FPC=str(intFCITC_list[1])
OUC2TEC=str(intFCITC_list[2])
OUC2FPL=str(intFCITC_list[3])
#Refer to any element by its index
if intFCITC_list[0]<0:
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 11:00,11/19/2009 12:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 12:00,11/19/2009 13:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 13:00,11/19/2009 14:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 14:00,11/19/2009 15:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 15:00,11/19/2009 16:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 16:00,11/19/2009 17:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 17:00,11/19/2009 18:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 18:00,11/19/2009 19:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 19:00,11/19/2009 20:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 20:00,11/19/2009 21:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 21:00,11/19/2009 22:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 22:00,11/19/2009 23:00')
    f.write ('OUCT,0,,,,,,OUC,FPL,11/19/2009 23:00,11/20/2009 00:00')
else:
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 11:00,11/19/2009 12:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 12:00,11/19/2009 13:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 13:00,11/19/2009 14:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 14:00,11/19/2009 15:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 15:00,11/19/2009 16:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 16:00,11/19/2009 17:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 17:00,11/19/2009 18:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 18:00,11/19/2009 19:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 19:00,11/19/2009 20:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 20:00,11/19/2009 21:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 21:00,11/19/2009 22:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 22:00,11/19/2009 23:00')
    f.write('OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/19/2009 23:00,11/20/2009 00:00')
if intFCITC_list[1]<0:
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 11:00,11/19/2009 12:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 12:00,11/19/2009 13:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 13:00,11/19/2009 14:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 14:00,11/19/2009 15:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 15:00,11/19/2009 16:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 16:00,11/19/2009 17:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 17:00,11/19/2009 18:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 18:00,11/19/2009 19:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 19:00,11/19/2009 20:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 20:00,11/19/2009 21:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 21:00,11/19/2009 22:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 22:00,11/19/2009 23:00')
    f.write ('OUCT,0,,,,,,OUC,FPC,11/19/2009 23:00,11/20/2009 00:00')
else:
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 11:00,11/19/2009 12:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 12:00,11/19/2009 13:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 13:00,11/19/2009 14:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 14:00,11/19/2009 15:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 15:00,11/19/2009 16:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 16:00,11/19/2009 17:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 17:00,11/19/2009 18:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 18:00,11/19/2009 19:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 19:00,11/19/2009 20:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 20:00,11/19/2009 21:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 21:00,11/19/2009 22:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 22:00,11/19/2009 23:00')
    f.write('OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/19/2009 23:00,11/20/2009 00:00')
if intFCITC_list[2]<0:
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 11:00,11/19/2009 12:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 12:00,11/19/2009 13:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 13:00,11/19/2009 14:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 14:00,11/19/2009 15:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 15:00,11/19/2009 16:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 16:00,11/19/2009 17:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 17:00,11/19/2009 18:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 18:00,11/19/2009 19:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 19:00,11/19/2009 20:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 20:00,11/19/2009 21:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 21:00,11/19/2009 22:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 22:00,11/19/2009 23:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 23:00,11/20/2009 00:00')
else:
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 11:00,11/19/2009 12:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 12:00,11/19/2009 13:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 13:00,11/19/2009 14:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 14:00,11/19/2009 15:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 15:00,11/19/2009 16:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 16:00,11/19/2009 17:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 17:00,11/19/2009 18:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 18:00,11/19/2009 19:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 19:00,11/19/2009 20:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 20:00,11/19/2009 21:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 21:00,11/19/2009 22:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 22:00,11/19/2009 23:00')
    f.write('OUCT,+OUC2TEC+,,,,,,,OUC,TEC,11/19/2009 23:00,11/20/2009 00:00')
if intFCITC_list[3]<0:
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 11:00,11/19/2009 12:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 12:00,11/19/2009 13:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 13:00,11/19/2009 14:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 14:00,11/19/2009 15:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 15:00,11/19/2009 16:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 16:00,11/19/2009 17:00')
    f.write ('OUCT,0,,,,,,OUC,TEC,11/19/2009 17:00,11/19/2009 18:00')
    f.write ('OUCT,0,,,,,,OUC

For starters, you can use one function to do the output. Also, store the output strings in a dictionary. You can then use a for loop to go through the
if intFCITC_list[0-->10]<0:
and send the appropriate string and starting time to the function to print. I only did the first two to give you an idea, and also assumed that 7 lines are written in every case. If you want to change the dates, you can supply a month, day, and year to a function to place it in the string prototypes. This code should run as is, although it prints instead of writing to a file for testing. Add some print statements if you don't understand what some variables contain.

'''A dictionary of lists.
The first list is for less than zero, the second list for not less than zero
The first string in each sub-list is the string to print
The second number is starting time (be sure to test for > 12:00)
'''
output_dict = {}
output_dict[0] = (['OUCT,0,,,,,,OUC,FPL,11/18/2009 %d:00,11/18/2009 %d:00', 0], \
                  ['OUCT,+OUC2FPL+,,,,,,,OUC,FPL,11/18/2009 %d:00,11/18/2009 %d:00', 0])
output_dict[1] = (['OUCT,0,,,,,,OUC,FPC,11/18/2009 %d:00,11/18/2009 %d:00', 0], \
                  ['OUCT,+OUC2FPC+,,,,,,,OUC,FPC,11/18/2009 %d:00,11/18/2009 %d:00', 0])

## dummy list for testing
intFCITC_list = []
intFCITC_list.append(-1)
intFCITC_list.append(1)

def print_this( format_list ):
    format_str = format_list[0]
    start_num = format_list[1]
    for y in range(7):
        print format_str % (start_num, start_num+1)
        start_num += 1
        if start_num > 12:
            start_num -= 12

for x in range(0, 2):
    output_list = output_dict[x]
    if intFCITC_list[x] < 0:
        less_than_list = output_list[0]
        print_this(less_than_list)
    else:
        not_less_list = output_list[1]
        print_this(not_less_list)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.