I am a beginner in Python programming but I believe the problem I am trying to solve might not be a big one.
So I am working on a program to present the last row on the latest csv file to the end user. At the moment I am copying and pasting the latest file from the FTP directory onto for example:
pd.read_csv("ftp://123.4.567.890/folder1/folder2/123.csv")
where 123.csv
is the latest file. Any solutions on how I might be able to get that 123.csv
file automatically on to the pandas read()
function? In addition, I am using Jupyter Notebook but I am somehow unable to change the working directory from my os to FTP. If I am able to do that it might be very helpful.
The arrangement of the files on the FTP directory looks like below with no column names-
02/03/2021 12:00AM 37,471 312.csv
02/03/2021 12:00AM 24,138 312.raw
01/26/2021 12:00AM 31,246 612.csv
01/26/2021 12:00AM 19,098 2612.raw
02/01/2021 12:00AM 15,337 0100.csv
02/01/2021 12:00AM 9,858 0100.raw
02/02/2021 12:00AM 134,098 0112.csv
So guys how to fetch the latest CSV file from above?
I would really appreciate your help.
Thanks