Can I output a simple text file of lines which are different
-
- New Member
- Posts: 2
- Joined: Tue Jun 15, 2004 3:22 pm
Can I output a simple text file of lines which are different
I am comparing two files and would like to produce an output file that is a simple text file containing the lines from file 1 which are different from file2.
Is this possible?
Is it possible to do this for all files in two directories which contain identically named files.?
Ideally I would like to be able to do this from a command line with no further interaction being required.
Is any of the above possible?
Is this possible?
Is it possible to do this for all files in two directories which contain identically named files.?
Ideally I would like to be able to do this from a command line with no further interaction being required.
Is any of the above possible?
Kevin S. Howell
-
- New Member
- Posts: 2
- Joined: Tue Jun 15, 2004 3:22 pm
I must obviously be doing something wrong, or we are talking at cross purposes. If I use just the /o option is does indeed produce a text file, but this is a unix style diff report rather than a file which contains just the lines from file 1.
e.g. the comparision produces
6,7c6,7
< Angel,George Henry D,Plympton,5b,363
< Angel,Maurice,Marylebone,1a,997
---
> Angel,George Henry D,Plympton St M,5b,*63
> Angel,Maurice,Marylebone,1a,**7
but I would like it to produce just
Angel,George Henry D,Plympton,5b,363
Angel,Maurice,Marylebone,1a,997
Is this possible?
Thanks in advance.
Kevin.
e.g. the comparision produces
6,7c6,7
< Angel,George Henry D,Plympton,5b,363
< Angel,Maurice,Marylebone,1a,997
---
> Angel,George Henry D,Plympton St M,5b,*63
> Angel,Maurice,Marylebone,1a,**7
but I would like it to produce just
Angel,George Henry D,Plympton,5b,363
Angel,Maurice,Marylebone,1a,997
Is this possible?
Thanks in advance.
Kevin.
Kevin S. Howell
-
- New Member
- Posts: 1
- Joined: Tue Jul 06, 2004 4:36 am
If you use such tools like the GNU unix tools for windows from http://unxutils.sourceforge.net/
you may add to your script something like this:
set DIFF_FILE=diff.txt
REM comp (whatever)
examdiff a b /o:%DIFF_FILE%
REM get rid of identical files
grep -v "^Identical files" %DIFF_FILE% > NOT_IDENTICAL_FILES.TXT
by using grep with -v it will copy all lines not beginning with Identical files to the new file: NOT_IDENTICAL_FILES.TXT
Did I understand your question correct?
you may add to your script something like this:
set DIFF_FILE=diff.txt
REM comp (whatever)
examdiff a b /o:%DIFF_FILE%
REM get rid of identical files
grep -v "^Identical files" %DIFF_FILE% > NOT_IDENTICAL_FILES.TXT
by using grep with -v it will copy all lines not beginning with Identical files to the new file: NOT_IDENTICAL_FILES.TXT
Did I understand your question correct?
Since it has been over 2 years from when this question was asked, I thought I would bring it back up. The only thing I need is a prog that can compare 2 text files and output another text file with just the lines that are different, and do this from the command line so I can script it.
Can the latest version do this?
Regards,
Craig
Can the latest version do this?
Regards,
Craig
I understand. However, this is the first program that I have found that can actually display just the differences in 2 files. The let down is that it cannot be saved so I have to copy and paste the results into 26 individual files every time I use it.
I'm not much of a programmer so I have no idea what is required to go from display to text file output. I'll keep checking back to see if this ever makes it into the program. Thanks!
- Craig
I'm not much of a programmer so I have no idea what is required to go from display to text file output. I'll keep checking back to see if this ever makes it into the program. Thanks!
- Craig
Basically, I have 26 pairs of text files, the old versions and the new versions in seperate directories. They are just rows of data like the following example:
id,eid,empstatus,6,6,Y,N,Y,Y,,,,,
What I want is to be able to compare each pair of files and output only the lines that differ in a 3rd text file. Also, I would like to be able to do this from the command line so that I can run one batch file and process all 26 pairs of files.
Let me know if I have left out any important details.
Thanks!
- Craig
id,eid,empstatus,6,6,Y,N,Y,Y,,,,,
What I want is to be able to compare each pair of files and output only the lines that differ in a 3rd text file. Also, I would like to be able to do this from the command line so that I can run one batch file and process all 26 pairs of files.
Let me know if I have left out any important details.
Thanks!
- Craig
simple output diff text
Hi,
I was planning to use your program to compare to two 50MB .csv files (yesterday and todays) which are uploaded to a website via FTP each night. I thought it was about time to only upload the differences. Alas it seems I can output the difference but you apend it with information which I then would have to strip out. I note your comments that no one has asked for this function, but think for a minute, if you provide a visual presentation of the information in your GUI, why would anyone need the information repeated in the diff output file, the very information invalidates it!
You would only need the physical diff file if you wanted to do something with it, wouldn't you? You could prepare a totally separate report with the information you currently put in the diff file, if needed.
If you ever put the (obviously needed) option in to your program to obtain a diff file, please email me and alert me because I will likely buy it; meantime I'll go shopping for one that does.
David
I was planning to use your program to compare to two 50MB .csv files (yesterday and todays) which are uploaded to a website via FTP each night. I thought it was about time to only upload the differences. Alas it seems I can output the difference but you apend it with information which I then would have to strip out. I note your comments that no one has asked for this function, but think for a minute, if you provide a visual presentation of the information in your GUI, why would anyone need the information repeated in the diff output file, the very information invalidates it!
You would only need the physical diff file if you wanted to do something with it, wouldn't you? You could prepare a totally separate report with the information you currently put in the diff file, if needed.
If you ever put the (obviously needed) option in to your program to obtain a diff file, please email me and alert me because I will likely buy it; meantime I'll go shopping for one that does.
David
It isn't pretty being easy