f = open('output.txt','r')
lines = f.readlines()
print lines
for i in range(0,len(lines)):
print lines[i]
#print lines
auto = raw_input("Enter account No::")
a=[]
j =[]
count =len(lines)
listSize = lines[count-1]
k= listSize.rstrip(",")
#print type(k)
print k
#k.split(",")
#a=k.split(",")[7]
a=k.split(",")
#for i in range(0,len(a)):
# print a[i]
#ab=""
#ab= str(int(a)+1)
this code will return the data in a list format, within a list. the output will look like this
['ds,r,r,2007-04-18,r,r,r,20070213,\n', '\n', 'f,m,45,2007-04-18,gsd,dfg,c,20070214,']
now my requirement is when the user enters a number eg:20070213 then it has to return
['ds,r,r,2007-04-18,r,r,r,20070213']
this 20070213 is an autogenerated number(primary key) with this key u need to retreive the corresponding values. This is like list in a list.

New Topic/Question
Reply




MultiQuote



|