0

I download many csv files daily. Because of the performance, without opening them, I like to quickly check if these csv files are modified or changed.

I did some tests and get to know that even a csv file is not changed not modified, that is, no new lines are added into it, the "Date modified" of the file is always updated when I downloaded it. So, it means, it is not a good idea to check "Date modified" property of the csv file to tell the file modification.

any suggestion or sample code in python,

Also, If I want to get all new added lines, how could I do in python in the fastest way?

Thanks a lot

Jeffery Wang
  • 105
  • 1
  • 9
  • 1
    To check if those files have not been changed you need to download them again, so ... just download them again :D – Olvin Roght May 03 '19 at 21:36
  • How are you downloading them? Depending on how that's being done (and the source of these CSV files), it _may_ be possible to do a timestamp comparison. – martineau May 03 '19 at 22:16

1 Answers1

0

I would import the two .csvs you want to compare into pandas dataframes to compare them.

Check out this post: Outputting difference in two Pandas dataframes side by side - highlighting the difference

This also describes how to show the differences.

cwalvoort
  • 1,851
  • 1
  • 18
  • 19