How to read last.specific line and column of CSV file with python
Hi!... Actually I can use re.findall to search a specific pattern, but now I need to retrieve the value in a specific column of that line. I'm not sure how well am I doing that, but here is a try I did according to some stuffs I've read in Sololearn ######## import re pattern="19:30" #Actually I can fin the line that contains the hour I need to extract #But I preffer some method to get the latest line of the file def count_char(text, char): count = 0 for c in text: if c == char: count += 1 return count filename = input("Enter a filename: ") with open(filename) as f: text = f.read() alfa=len((re.findall(pattern, text))) print(alfa) #Print how many times my patter appears... just one time in this case f.close() #Close file