Re: File Compare with difflib.context_diff

2009-03-20 Thread JanC
JohnV wrote: > I have a txt file that gets appended with data over a time event. The > data comes from an RFID reader and is dumped to the file by the RFID > software. I want to poll that file several times over the time period > of the event to capture the current data in the RFID reader. > > W

Re: File Compare with difflib.context_diff

2009-03-19 Thread JohnV
Here is the latest version of the code: currentdata_file = r"C:\Users\Owner\Desktop\newdata.txt" # the latest download from the clock lastdata_file = r"C:\Users\Owner\Desktop\mydata.txt" # the prior download from the clock output_file = r"C:\Users\Owner\Desktop\out.txt" # will hold delta clock dat

Re: File Compare with difflib.context_diff

2009-03-18 Thread JohnV
The below code does the trick with one small problem left to be solved import shutil import string currentdata_file = r"C:\Users\Owner\Desktop\newdata.txt" # the current download from the clock lastdata_file = r"C:\Users\Owner\Desktop\mydata.txt" # the prior download from the clock output_file =

Re: File Compare with difflib.context_diff

2009-03-18 Thread Gabriel Genellina
En Wed, 18 Mar 2009 21:02:42 -0200, Emile van Sebille escribió: JohnV wrote: > What I want to do is compare the old data (lets day it is saved to a file called 'lastdata.txt') with the new data (lets day it is saved to a file called 'currentdata.txt') and save the new appended data to a va

Re: File Compare with difflib.context_diff

2009-03-18 Thread Emile van Sebille
JohnV wrote: > What I want to do is compare the old data (lets day it is saved to a file called 'lastdata.txt') with the new data (lets day it is saved to a file called 'currentdata.txt') and save the new appended data to a variable You may get away with something like: (untested) newdata=op

Re: File Compare with difflib.context_diff

2009-03-18 Thread JohnV
Maybe something like this will work though I am not sure of my quotes and what to import import shutil f = open(r'C:\Users\Owner\Desktop\mydata.txt', 'r') read_data1 = f.read() f.close() shutil.copy('C:\Users\Owner\Desktop\newdata.txt', 'C:\Users\Owner \Desktop\out.txt') file = open(r'C:\Users\O

Re: File Compare with difflib.context_diff

2009-03-18 Thread Chris Rebert
On Wed, Mar 18, 2009 at 2:30 PM, JohnV wrote: > I have a txt file that gets appended with data over a time event.  The > data comes from an RFID reader and is dumped to the file by the RFID > software.  I want to poll that file several times over the time period > of the event to capture the curre

File Compare with difflib.context_diff

2009-03-18 Thread JohnV
I have a txt file that gets appended with data over a time event. The data comes from an RFID reader and is dumped to the file by the RFID software. I want to poll that file several times over the time period of the event to capture the current data in the RFID reader. When I read the data I wan