#This program will append "CJH01" to the end of each number in a list. #The resulting list can then be used as an Aleph input file. import os def appendCJH01(path): #defines function names "appendCJH01" txtfile=open(path, "r") #opens the file & names the data set inside it "txtfile" lines=txtfile.readlines() #creates list names "lines" with /n at end of each number txtfile.close() #closes original file txtfile=open(path, "w") #re-opens file & its deletes current version for l in lines: l=l.replace("\n", "") #deletes \n on each number by replacing it with nothing txtfile.write(l + "CJH01\n") #adds "CJH)!" & line breaks to each number txtfile.close() #saves & closes new version of file #to run, type the name of the function & with the path as the parameter #for example: appendCJH01(r"C:/Users/jtaylor/Desktop/tbdeleted.txt")