I am reading a file line by line and let's say I don't care about anything except "if" this line of the file contains an upper case letter. Because if it does I want to use it. I don't want to use the this line of the file if it does not.
Could I use just an if statement for this? or do I have to use a for loop. I already have two nested statements.
My code:
with open(var) as config_file: #open file
for line in config_file: #line by line reading of file
#if "description" and capital letter is contain in line:
line = line.replace('\n' , '').replace('"' , '').replace(']' , '') #removes all extra characters
i = "| except " + (line.split("description ", 1)[1]) + " " #split the line and save last index (cust name)
cus_str+=i #append to string
config_file.close()