Python Forum
A simple problem, how best to solve it?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A simple problem, how best to solve it?
#1
This seems quite simple compared to many problems I've had. However, I'm not finding an elegant solution at the moment.

I have two csv files and I'd like to combine them and then write them to another csv file. My problem is that these csv files are constantly being updated and I don't want to miss out on any updates. If I combine a row of data and then save it to another csv file, I might have missed out on further updates to the csv file or I might miss a row of data if several get put into the first csv file at once. However if I simply combine all the rows with the current piece of data, I may have issues saving the new amended data to a csv file. There are various things that can go wrong.

Is there an easy way to do this that I'm not thinking of?
Reply
#2
Do the files contain a timestamp? Synchronize on that. Otherwise, there is no synchronization and your combined file is meaningless.
Gribouillis likes this post
Reply
#3
Quote:these csv files are constantly being updated

If everything is constantly updating, you will just need to do this regularly. You will always miss something!

Set a cronjob to run your Python script every hour or whatever.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can someone help me solve this programming problem? SuchUmami 6 926 Nov-20-2023, 10:01 AM
Last Post: EdwardMatthew
  How to solve this simple problem? Check if cvs first element is the same in each row? thesquid 2 1,247 Jun-14-2022, 08:35 PM
Last Post: thesquid
  How do I solve the second problem? Cranberry 1 1,139 May-16-2022, 11:56 AM
Last Post: Larz60+
  Try to solve GTG multiplication table problem. Frankduc 6 2,024 Jan-18-2022, 08:26 PM
Last Post: Frankduc
  Sudoku Solver, please help to solve a problem. AdithyaR 5 2,135 Oct-28-2021, 03:15 PM
Last Post: deanhystad
Big Grin question about simple algorithm to my problem jamie_01 1 1,695 Oct-04-2021, 11:55 AM
Last Post: deanhystad
  Solve simple equation in Python kmll 4 3,113 Nov-01-2020, 04:34 PM
Last Post: deanhystad
  General list size question to solve problem Milfredo 3 2,370 Sep-27-2020, 08:42 AM
Last Post: Milfredo
  I want to solve the following problem srisrinu 4 5,965 May-09-2020, 01:07 PM
Last Post: Larz60+
  simple login problem MMOToaster 2 2,413 Feb-25-2020, 09:28 AM
Last Post: MMOToaster

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020