I want to read a line in the file and check the content in the line, for example if the line starts with the text "sample test ..." i want to check wether the line starts with sample, but my code always return no result even thou the file contains "sample test ..."
root = "\home\sathappan"
inputfile = os.path.join(root,"data.txt")
outputfile = os.path.join(root,"dataexp.bat")
a = open(inputfile)
b = open(outputfile,"a")
line = a.readline().strip()
if line == 'Sample*':
sampe test line