# Purpose: Read the input file and write it to another file
#          Example of deleting a column.
# Usage: No arguments required.  Input file hard-coded.
# Output: Modified text file RDUout4.txt in the scratch directory.
inputFile = "C:/gispy/data/ch19/RDUforest.txt"
outputFile = "C:/gispy/scratch/RDUout4.txt"

if os.path.exists(inputFile):
    inf = open(inputFile, 'r')
    outf = open(outputFile, 'w')

    contents = inf.readlines()
    for line in contents:
        splitLine = line.split("\t")  # Convert it to a list.

        #Block = splitLine[0]
        #Plot = splitLine[1]
        #Species = splitLine[2]
        #DBH = splitLine[3]
        splitLine.pop(1) #Pop the plot off the list.
        
        newLine = "\t".join(splitLine)  # Convert it to a string.
              
        outf.write(newLine)

    inf.close()
    outf.close()
    
    print("{0} created.".format(outputFile))


