Python Forum
Watch new files and modify it
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Watch new files and modify it
#1
Hello everyone,

I'm looking for some help on one of my project. I will try to describ my problem as best as I can.

I have a .txt files generated by a software every 50-60sec around. The new file replaces the last one, the name stay the same.
I want to open that files when he is written, modify some line et save to another folder.

My problem : I don't how to watch a specific folder to see new files. Can you help me on it?

I have search on google without success, maybe I didn't have the right key work for this.

Thank you all of you for your help, Big Grin Big Grin
Reply
#2
have a look at watchdog
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
There's also pywatch you can use. Wrapper around linux watch command.
Reply
#4
You could use git, make a commit, then come back later and compare and contrast the difference with diff argument. The python standard library difflib is similar if you want to programmatically do it.
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Watch SFTP Folder torz 2 9,179 Dec-02-2017, 01:42 AM
Last Post: torz
  how to watch for file in folder bowen73 11 18,220 Aug-22-2017, 01:35 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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