Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Is there a way to create a program in excel to compare files?

I am trying to clean up my drives and am looking for a way to compare and
delete by my specifications. All of the programs I have used, either lump
all files and compare by name only, for do not have the inteligence to allow
me to select the order of dirctories to delete from. I would also like it
to leave certain subdirectories alone, but use them to compare to other
files.
Would this God awful slow?


I hope I am making this clear enough...

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Is there a way to create a program in excel to compare files?

Not certain I completely understand what you are trying
to do, but you can write your directories to a file from
DOS, Dir tofilelist. Been a while since I have done
this and I only got the immediate directory list. Maybe
someone can remeber how to get the drive. Once you get
it, you can open in Excel. Think if you have to you can
append to the to the "tofilelist" file.
-----Original Message-----
I am trying to clean up my drives and am looking for a

way to compare and
delete by my specifications. All of the programs I have

used, either lump
all files and compare by name only, for do not have the

inteligence to allow
me to select the order of dirctories to delete from. I

would also like it
to leave certain subdirectories alone, but use them to

compare to other
files.
Would this God awful slow?


I hope I am making this clear enough...

Thanks


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Is there a way to create a program in excel to compare files?

I have no problem doing a DIR *.jpg /s templist.txt type of thing. (I have
been playing with DOS since DOS 1.x!!!!) I can even import that into Excel.
What I then want to do is to do a bit by bit compare on the files that have
the same size. This is the part I do not know how to do.
I could even figure out how not to delete from certain directories (I think)
I am not sure if I could also put a preference together for which
directories would have a "preferred" delete from over a different
subdirectory

Thanks

Bruce

"David" wrote in message
...
Not certain I completely understand what you are trying
to do, but you can write your directories to a file from
DOS, Dir tofilelist. Been a while since I have done
this and I only got the immediate directory list. Maybe
someone can remeber how to get the drive. Once you get
it, you can open in Excel. Think if you have to you can
append to the to the "tofilelist" file.
-----Original Message-----
I am trying to clean up my drives and am looking for a

way to compare and
delete by my specifications. All of the programs I have

used, either lump
all files and compare by name only, for do not have the

inteligence to allow
me to select the order of dirctories to delete from. I

would also like it
to leave certain subdirectories alone, but use them to

compare to other
files.
Would this God awful slow?


I hope I am making this clear enough...

Thanks


.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Is there a way to create a program in excel to compare files?

Hi Bruce,
Simple answer don't use Excel for this. In fact I cannot see why you would
want to?

Some form of CRC tool and comparator is probably the answer , have a look at
the following link...

http://www.prestosoft.com/ps.asp?page=edp_examdiffpro

Cheers
Nigel

"bruce" wrote in message
news:7TSvc.37539$pt3.8849@attbi_s03...
I have no problem doing a DIR *.jpg /s templist.txt type of thing. (I

have
been playing with DOS since DOS 1.x!!!!) I can even import that into

Excel.
What I then want to do is to do a bit by bit compare on the files that

have
the same size. This is the part I do not know how to do.
I could even figure out how not to delete from certain directories (I

think)
I am not sure if I could also put a preference together for which
directories would have a "preferred" delete from over a different
subdirectory

Thanks

Bruce

"David" wrote in message
...
Not certain I completely understand what you are trying
to do, but you can write your directories to a file from
DOS, Dir tofilelist. Been a while since I have done
this and I only got the immediate directory list. Maybe
someone can remeber how to get the drive. Once you get
it, you can open in Excel. Think if you have to you can
append to the to the "tofilelist" file.
-----Original Message-----
I am trying to clean up my drives and am looking for a

way to compare and
delete by my specifications. All of the programs I have

used, either lump
all files and compare by name only, for do not have the

inteligence to allow
me to select the order of dirctories to delete from. I

would also like it
to leave certain subdirectories alone, but use them to

compare to other
files.
Would this God awful slow?


I hope I am making this clear enough...

Thanks


.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Is there a way to create a program in excel to compare files?

If you have WORD and your files are text files, create two documents in respect of each file: he first contains the 'source' and the second the 'target'

Open either the 'source' or the 'target' in WORD and then use : Tools | Track Changes |Compare Documents. This will alter the document you have open (so don't save it or you'll overwrite the original). The active document has vertical bars in the left margin wherever there are differences. Text which has been struck through indicates text that has been removed; text that is underlined shows new text. The comparison is text sensitive.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Is there a way to create a program in excel to compare files?

I have not found any CRC checkers that will allow me to control the deleted
files well enough (from certain subdirectories not to delete files from but
still use the files to compare against) or controlling which subdirectories
have the preferred deletion.

I am looking at ExamDiffPro now, but from what I see, it does not do it
either.

The best I have seen so far is "CloneMaster" If it just had a option to the
directory controls, it would be great!

All I need to know is how to read a binary file (which should not be to big
of a deal) and then how to compare. Since we ARE talking BINARY files, I am
NOT sure how to do this in Excel.....
The rest, I know how to do. Excel is the method I would use as I am more
familiar with it than any other langage, and it would allow me to sort the
directories and other manipulations

Thanks

Bruce

"Nigel" wrote in message
...
Hi Bruce,
Simple answer don't use Excel for this. In fact I cannot see why you

would
want to?

Some form of CRC tool and comparator is probably the answer , have a look

at
the following link...

http://www.prestosoft.com/ps.asp?page=edp_examdiffpro

Cheers
Nigel

"bruce" wrote in message
news:7TSvc.37539$pt3.8849@attbi_s03...
I have no problem doing a DIR *.jpg /s templist.txt type of thing. (I

have
been playing with DOS since DOS 1.x!!!!) I can even import that into

Excel.
What I then want to do is to do a bit by bit compare on the files that

have
the same size. This is the part I do not know how to do.
I could even figure out how not to delete from certain directories (I

think)
I am not sure if I could also put a preference together for which
directories would have a "preferred" delete from over a different
subdirectory

Thanks

Bruce

"David" wrote in message
...
Not certain I completely understand what you are trying
to do, but you can write your directories to a file from
DOS, Dir tofilelist. Been a while since I have done
this and I only got the immediate directory list. Maybe
someone can remeber how to get the drive. Once you get
it, you can open in Excel. Think if you have to you can
append to the to the "tofilelist" file.
-----Original Message-----
I am trying to clean up my drives and am looking for a
way to compare and
delete by my specifications. All of the programs I have
used, either lump
all files and compare by name only, for do not have the
inteligence to allow
me to select the order of dirctories to delete from. I
would also like it
to leave certain subdirectories alone, but use them to
compare to other
files.
Would this God awful slow?


I hope I am making this clear enough...

Thanks


.







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Is there a way to create a program in excel to compare files?

Speaking of DOS 1.x. The trusty old FC (filecompare) DOS command is still
available in Windows XP. Below is some basic code to compare two files. A
text output file named FC.TXT will be created with the results of the
binary file comparison.

If the files have any binary differences the output will look something like
this:
Comparing files C:\TEMP\TestFile1.txt and C:\TEMP\TestFile2.txt
0000002A: 33 34

If the files don't have any binary differences the output will look
something like this:
Comparing files C:\TEMP\TestFile1.txt and C:\TEMP\Copy of TestFile1.txt
FC: no differences encountered

You can look for the "FC: no differences encountered" string on line2 of the
output file. Your command line may have a limit on the number of characters
passed (~127).

Troy


Sub TestSomeFiles()
Dim sFile1 As String
Dim sFile2 As String
Dim vFcn As Variant

sFile1 = "c:\temp\TestFile1.txt"
sFile2 = "c:\temp\TestFile2.txt"

vFcn = fcnDOS_FileCompare(sFile1, sFile2)

End Sub

Function fcnDOS_FileCompare(sFile1 As String, sFile2 As String)
Dim sCmd As String
Dim sFC_Filename As String

'Name of the file to direct the output of the DOS FC command to.
sFC_Filename = "c:\temp\FC.TXT"

'--- VBA and Shell are asynchronous, need to wait for FC to finish.
If Dir(sFC_Filename) < "" Then Kill sFC_Filename
Open sFC_Filename For Random As #1
Close #1

sCmd = "command.com /c FC /B " & _
"""" & sFile1 & """" & " " & _
"""" & sFile2 & """" & " " & _
" " & sFC_Filename

Shell sCmd
Do While FileLen(sFC_Filename) = 0
DoEvents
Loop

'Check for "FC: no differences" in the output file

End Function


The FC command has the following syntax and switches

FC [/Switches] [drive:][\dir\]file1 [drive:][\dir\]file2
Switches:

/B Performs a binary comparison.
The two files are compared byte by byte and there is no attempt to
resynchronize the files after finding a mismatch. This is the default mode
for comparing files when file1 has an extension of .EXE, .COM, .SYS, .OBJ,
..LIB, or .BIN.
/L Compares files as ASCII.
The two files are compared line by line and FC attempts to
resynchronize the files after finding a mismatch. This is the default mode
for comparing files when file1 does not have an extension of .EXE, .COM,
..SYS, .OBJ, .LIB, or .BIN.
/LBn Sets the number of lines for the internal line buffer.
If the files being compared have more than this number of consecutive
differing lines, FC cancels the comparison.
Default value of n: 100
/nn The number of consecutive lines that must match before the files
are declared resynchronized. If the number of matching lines in the files is
less than this number, the matching lines are displayed as differences.
Default value of nn: 2.
/N Displays the line numbers on an ASCII comparison.
/A Abbreviates the output of an ASCII comparison. Only the first and
last line for each set of differences is displayed as opposed to the default
of every different line.
/C Disregards the case of letters.
/T Does not expand tabs to spaces.
By default, tabs are treated as spaces with 1 tab = 8 spaces.
/W Compresses tabs and multiple spaces to a single space for the
comparison.



"bruce" wrote in message
news:7TSvc.37539$pt3.8849@attbi_s03...
I have no problem doing a DIR *.jpg /s templist.txt type of thing. (I

have
been playing with DOS since DOS 1.x!!!!) I can even import that into

Excel.
What I then want to do is to do a bit by bit compare on the files that

have
the same size. This is the part I do not know how to do.
I could even figure out how not to delete from certain directories (I

think)
I am not sure if I could also put a preference together for which
directories would have a "preferred" delete from over a different
subdirectory

Thanks

Bruce



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Is there a way to create a program in excel to compare files?

This will probably work OK! In order to get around of the 128 char len
difference, I could copy the two files to compare to a "\temp\ subdirectory"
Slower then doing something native, and in its original subdirectory, but it
aleast gives me control of what directories are effected and what order to
delete from!

Thanks
Bruce

"TroyW" wrote in message
...
Speaking of DOS 1.x. The trusty old FC (filecompare) DOS command is still
available in Windows XP. Below is some basic code to compare two files. A
text output file named FC.TXT will be created with the results of the
binary file comparison.

If the files have any binary differences the output will look something

like
this:
Comparing files C:\TEMP\TestFile1.txt and C:\TEMP\TestFile2.txt
0000002A: 33 34

If the files don't have any binary differences the output will look
something like this:
Comparing files C:\TEMP\TestFile1.txt and C:\TEMP\Copy of TestFile1.txt
FC: no differences encountered

You can look for the "FC: no differences encountered" string on line2 of

the
output file. Your command line may have a limit on the number of

characters
passed (~127).

Troy


Sub TestSomeFiles()
Dim sFile1 As String
Dim sFile2 As String
Dim vFcn As Variant

sFile1 = "c:\temp\TestFile1.txt"
sFile2 = "c:\temp\TestFile2.txt"

vFcn = fcnDOS_FileCompare(sFile1, sFile2)

End Sub

Function fcnDOS_FileCompare(sFile1 As String, sFile2 As String)
Dim sCmd As String
Dim sFC_Filename As String

'Name of the file to direct the output of the DOS FC command to.
sFC_Filename = "c:\temp\FC.TXT"

'--- VBA and Shell are asynchronous, need to wait for FC to finish.
If Dir(sFC_Filename) < "" Then Kill sFC_Filename
Open sFC_Filename For Random As #1
Close #1

sCmd = "command.com /c FC /B " & _
"""" & sFile1 & """" & " " & _
"""" & sFile2 & """" & " " & _
" " & sFC_Filename

Shell sCmd
Do While FileLen(sFC_Filename) = 0
DoEvents
Loop

'Check for "FC: no differences" in the output file

End Function


The FC command has the following syntax and switches

FC [/Switches] [drive:][\dir\]file1 [drive:][\dir\]file2
Switches:

/B Performs a binary comparison.
The two files are compared byte by byte and there is no attempt to
resynchronize the files after finding a mismatch. This is the default mode
for comparing files when file1 has an extension of .EXE, .COM, .SYS, .OBJ,
.LIB, or .BIN.
/L Compares files as ASCII.
The two files are compared line by line and FC attempts to
resynchronize the files after finding a mismatch. This is the default mode
for comparing files when file1 does not have an extension of .EXE, .COM,
.SYS, .OBJ, .LIB, or .BIN.
/LBn Sets the number of lines for the internal line buffer.
If the files being compared have more than this number of

consecutive
differing lines, FC cancels the comparison.
Default value of n: 100
/nn The number of consecutive lines that must match before the files
are declared resynchronized. If the number of matching lines in the files

is
less than this number, the matching lines are displayed as differences.
Default value of nn: 2.
/N Displays the line numbers on an ASCII comparison.
/A Abbreviates the output of an ASCII comparison. Only the first and
last line for each set of differences is displayed as opposed to the

default
of every different line.
/C Disregards the case of letters.
/T Does not expand tabs to spaces.
By default, tabs are treated as spaces with 1 tab = 8 spaces.
/W Compresses tabs and multiple spaces to a single space for the
comparison.



"bruce" wrote in message
news:7TSvc.37539$pt3.8849@attbi_s03...
I have no problem doing a DIR *.jpg /s templist.txt type of thing. (I

have
been playing with DOS since DOS 1.x!!!!) I can even import that into

Excel.
What I then want to do is to do a bit by bit compare on the files that

have
the same size. This is the part I do not know how to do.
I could even figure out how not to delete from certain directories (I

think)
I am not sure if I could also put a preference together for which
directories would have a "preferred" delete from over a different
subdirectory

Thanks

Bruce





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel files in separate program windows Jason Dove Excel Discussion (Misc queries) 27 October 24th 08 07:58 PM
Cannot open excel files unless from the program itself Pedro Setting up and Configuration of Excel 0 November 14th 07 11:41 AM
Is there a good program for excel to combine, compare, and edit bo Myles Excel Discussion (Misc queries) 1 July 19th 07 06:46 PM
XP Excel program changes all my files to not duplex as stored agridsl Setting up and Configuration of Excel 0 November 1st 05 07:02 PM
Why does my excel program create a .xls:1 extension? Laura Excel Discussion (Misc queries) 2 April 12th 05 10:16 PM


All times are GMT +1. The time now is 05:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"