In a log file, there are .csv files and I need to find only one occurrence of that file name with file extension.
Example: Abcde.csv
I have this below line but it finds all the csv files with filepath within the words “Importing file ./“ and “.”. It also isn’t considering “.” full stop in the sentence and printing the next line.
for result in re.findall(‘Importing file ./(.*?).’, fp.read(), re.S):
Is there any way I can get only the filename with file extension.
Current result:
/user/path/abcde.csv
Line number :1235
Expectation:
abcde.csv
Update- Current line :
Line number 12983: Importing file /user/path/abcde.csv.