This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This works. Yields the last line of the file as a string without reading the entire file into memory. | |
#Use a parsing function to separate returned data by commas to select the desired element. | |
import os | |
def get_last_line_records_of_file(identifier_data): | |
filepath = linux_path+"/"+identifier_data+".csv" | |
try: | |
with open(filepath,'rb') as f: | |
f.seek(-1,os.SEEK_END) |