Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




VbCrLf And VbLf Comparison In Text File.


Hello there, everybody?

I have two text files. One was generated under windows so "vbCrLf" is as newline break for each line.
The other one is generated under *NIX OS so "vbLf" is used.

Both files have the same format except for the "vbCrLf" and "vbLf".

How could I distinguish those two?
Suppose that each line has a length of 30 characters exactly with no exception.
I've tried
Code:
delimiter = vbCrLf
''' used 31 because each line contains 30 chars and 31st character is the newline character
if (strcomp(right(input(31, fh), 1), vbLf, vbTextCompare)) then
  delimiter = vbLf
end if


I've also tried "vbBinaryCompare" for the above comparison but I have been fruitless.
I would appreciate your kind helps




Edited by - dance2die on 6/1/2004 11:14:12 AM




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Check If File Has Vbcrlf Or Vblf
Hi guys!

How can I know if a file has any of these vbcrlf or vblf characters?

Based on that result, I would process the files.......Otherwise, if I anticipate that I get a good file all the time...then I am screwed, as it happened today....

Can anyone tell me?

VbCrLf,vbLf,vbCr
Hi people, I have a simple question. Is there any function like TRIM wich i can get a clean string without vbCrLf,vbLf,vbCr?
Sorry my english. Thanks in advance. Bye!

Difference Between VbCrLf And VbLf
Ok, i'm encountering some problem with the use of VbCrlf (Carriage Return LineFeed Combination) with my richedit control, as an alternative, i plan to force my RichEdit control to use VbLf (linefeed, chr(10)) using code, whenever the user presses the "ENTER" key on their keyboard

The end result is that i get less error with VbLf and my app have no error anymore, i notice there's not much difference between the two as well, but just for safety's sake , can anyone tell me the difference between them?

VbCrlf, VbCr, VbLf
What do vbCrlf, vbCr and vbLf do? Please inform this rookie!!!

RichtextBox Vbcr - Vblf - VbCrlf Problem
Hello !
I am using a richtextbox . The problem things that strange problems happen with vbcr , vblf , vbcrlf.
I load into the richtextbox a file that is a webpage source.
This webpage can also have been written in unix etc. with no
windows standard line feed character.

I do instr("mytext") and get a value 10 for example
the problem is that because of vblf is not counted as a character or something like that when i do richtextbox.selstart=10
instead of going to the "mytext" it goes much after or before the position of "mytext".

What is the windows standard character for line feed?
Should i replace vbcr and vblf with vbcrlf in the beginning ?

thanks !

VBCrLf Comparison
I'm using Microsoft Rich Text Box 6.0 (sp4) from richtx32.ocx. When pressing a pushbutton I want to remove one leading blank line from the editor control text.
Currently, I'm reading the text out of the control into a work variable then doing a msgbox on the work variable. I hoped the message would show the literal used for the carriage return (which I expected to be VBCrLf). Instead I see the text exactly as I see it in the text editor.

Note: I am restricted to vbScript for this task.

Thanks,
Jake

Text File Comparison
Hi All

I have got a program that reads from a textfile , either comma or pipe delimited.

I have got 2 option buttons comma(option1) and pipe(option 2) , what i want
to do is once the user has opened the text file with the app and selected the option
he wants , i want to be able to check that the text file is in fact a pipe or comma
delimited text file. For instance if the user selects option 1 and the textfile is in fact a pipe delim file
then i want the program to show a message box displaying an error and once
the user has seen the error he can then rectify his mistake by selecting option 2.

Here is the code that i am using

<CODE>
Dim i As Integer
Dim j As Integer

On Error Resume Next
Open txtInput.Text For Input As #1
Open txtOutput.Text For Output As #3

If optComma.Value = True Then
strDelimiter = ","
Else
strDelimiter = "|"
End If

Do While Not EOF(1)
Line Input #1, Record1
strDoubles = Record1
For i = 1 To Len(strDoubles)
If InStr(1, strDoubles, Chr(34)) Then
If InStr(1, strDoubles, ",") Then
MsgBox "Commas?", vbCritical
Exit Sub
ElseIf InStr(1, strDoubles, "|") Then
MsgBox "Pipe?", vbCritical
Exit Sub
End If

strDoubles = Replace(Record1, Chr(34), "")
Exit For
Else
Exit For
End If
'End If
Next i



Open txtInput2.Text For Input As #2
Do While Not EOF(2)
Line Input #2, Record2
strDoubles2 = Record2
For j = 1 To Len(strDoubles2)
If InStr(1, strDoubles2, Chr(34)) Then
If InStr(1, strDoubles2, ",") <> strDelimiter Then
MsgBox "Commas?", vbCritical
Exit Sub
ElseIf InStr(1, strDoubles2, "|") <> strDelimiter Then
MsgBox "Pipe?", vbCritical
Exit Sub
End If
strDoubles2 = Replace(Record2, Chr(34), "")
'Debug.Print strDoubles
Exit For
Else
Exit For
End If
' End If
Next j

aryRecord1 = Split(strDoubles, strDelimiter)
aryRecord2 = Split(strDoubles2, strDelimiter)
If aryRecord1(0) = aryRecord2(1) Then
Print #3, aryRecord2(0) & strDelimiter & aryRecord1(1) & strDelimiter & aryRecord1(2) 'aryRecord1(0) & strDelimiter & itm1
End If
Loop
Close #2
Loop

Close #1
Close #3

DisplayOutput
</CODE>

Can anyone help.

Thanks

Text File Comparison
Hello,

I am a new to programming and I am currently working on writing a program that will allow me to take two text files and compare the data in each one of them to see if there are any duplicate records. It is important to note that these text files can be in many different formats. After the program has cross checked both text files and identified the duplicate records, I want to create a new text file that has the identified items in it.


Any help with this would be greatly appreciated - Daniel Santucci

Opening A Huge Text File (16M) For Reading &amp; Comparison
I've searched the forum, and haven't been able to find code that helps me out.

I'm somewhat new to VB.

First, background on the program I'm writing.

The program opens an excel file with data to be scrubbed against a text file.

The program reads and navigates excel files fine...but I'm can't find the code to read and navigate a text file.

the text file is over a million phone numbers separated by new lines.

I can't import the file into an excel spreadsheet because excel files have a limit of 32,000 entries.

now....what I need:

What is the quickest way of opening the file to navigate it and compare values to the values I pull from the excel file?

If someone can give me some sample code, or a link to some code to point me in the right direction, I'd appreciate it. Thanks!

Parsing Http Response From Winsock.. (not As Easy As Split(data,vbcrlf + Vbcrlf,2))
How can I get the response from a http response?
Its not as simple as split(data,vbcrlf + vbcrlf,2)).

Although this code will split the headers from the response, the response still has some data seperating the response from the content.

For example:

Code:
HTTP/1.1 200 OK
Date: Tue, 15 Aug 2006 04:21:21 GMT
P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
Set-Cookie: B=2tu47kd2e2iu1&b=3&s=bo; expires=Tue, 02-Jun-2037 20:00:00 GMT; path=/; domain=.yahoo.com
Set-Cookie: Y=%2e; expires=Thu, 15 Apr 2010 20:00:00 GMT; path=/; domain=.yahoo.com
Set-Cookie: T=z=0; expires=Thu, 01 Jan 1970 22:00:00 GMT; path=/; domain=.yahoo.com

488e






<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


as you can see, theres a lot of line feeds in there, along with '488e' for example. there is also some data at the end that is not content. for example

Code:
</script><noscript><img width=1 height=1 alt="" src="http://us.bc.yahoo.com/b?P=uxTpetFJqEphspzhEyL0KQCGRCcnvkThS8EADhgX&T=13vjf0es1%2fX%3d1155615681%2fE%3d150001456%2fR%3dregst%2fK%3d5%2fV%3d3.1%2fW%3d9%2fY%3dYAHOO%2fF%3d531325196%2fQ%3d-1%2fS%3d1%2fJ%3d48A849D1"></noscript></html>

0


Note the 0 there with additional line feeds. you might think looking though the response and assuming that the content begins at a "<" will signify the start of the content, and the last ">" signifies the end, but this will not work if the content retrieved is an image, or gzip content, etc.

So.. how can you get the content from the response?
Is there a standard for this?

How To Replace Text With VbCrLf
hi everybody..
i have this problem with my vb, i want to replace some text with a carriage return. If i'm using ordinary text as a replacement text it goes fine but when i use vbcrlf the result is not a carriage return.
any one can help me..?

Drawing Text With Vbcrlf?
I figured it out, MAH BAD

there's no delete button on the forum

that I can see, anyway

Display Text With Vbcrlf In Them
I've created a function that will loop round records in a recordset and bring me back the data i want to display.

The function is

Public Function LoadHistory(ByRef lngProject As Long) As String

Dim rsHistory As New ADODB.Recordset
'Set rsProject = GetRecordset(strSQL)
Set rsHistory = GetRecordset("select * from t_ProjectHistory where projectid = " & lngProject)
Dim sSql As String
'sSql = "========================" & vbCrLf
With rsHistory
If Not .EOF Then
.MoveFirst
Do Until .EOF
sSql = sSql & "On " & .Fields("HistoryDate") & " " & Trim(.Fields("HistoryUser")) & " wrote : " & vbCrLf & .Fields("Comments") & vbCrLf
sSql = sSql & "=================================================" & vbCrLf
.MoveNext
Loop
End If
End With


LoadHistory = sSql

rsHistory.Close
Set rsHistory = Nothing

End Function

later when i call that funtion I want to display the results in one text box, like this

frm_Main.txtComments = LoadHistory(.Fields("Projectid"))

This works, and does give me the result back, but not the carradge returns and lines feeds, instead of getting back this

On 05/11/2007 debbie.coates wrote :
Comment One
=================================================
On 05/11/2007 debbie.coates wrote :
Comment Two
=================================================

i get this

On 05/11/2007 debbie.coates wrote : ||tHE QUICK BROWN FOX JUMPS OVER THE LAZY DOG||=================================================||On 05/11/2007 debbie.coates wrote :
tHE CAT IN THE HAT

so the text is all on one line. does anyone know why this is?

Vbcrlf Not Working In Text Box
vbcrlf in a textbox control is coming up as |

multi-line is set to true.

Any ideas?

Thanks!

Removing VbCrLf From Text.
Hi,
I my program I have a message like this:
............................................
RTU2MTNCNEY5MDZGNzNEQkU5QUQ4MjhENzg2N0ZE
kQyMzk0NjBGNDk4Q0MyRDQ0QzI3RUNERUQ4MzExQj
BNDhGNzhFNkFBODY5REI4Q0Y0MkJFNUY2MTAzNEIx
0Y5MUUxRDZDRUNERUU5NkE3ODhBQUIyNzA5QTYxRk
0QUFDMUY4NEZGOTFEMzQzRjhDQUFDNDM1OURBRURD
UFFRjcxOTgzMTU3MDQyRDI2QTUyOERGQ0I4NEJCRj
2MUIxQTIzNkY5NUJENjg2Q0U1QjUzOTA0REM0ODc3
UY0NTBGQzY2RTE4ODEzNUUyOUI4Qjg0ODdBNEM3OU
............................................

I have reassembled the message in text box by restricting
each line to 41 characters length, by using "VbCrLf".
I used the following code:
--------------------------------------
j = 1
For i = 1 To l
If j < 41 Then
strM(j) = Mid$(sText, i, 1)
txtNewMessage.Text = txtNewMessage.Text & strM(j)
j = j + 1
Else
j = 0
txtNewMessage.Text = txtNewMessage.Text & vbCrLf
End If
Next i
----------------------------------------
The Assembling is done well, but now I want to deassemble, so
as to fill the text box as it was originally. I want to
remove those "VbCrLf"'s. How to do so?

..........
Rohit

Vbcrlf Not Working In Tool Tip Text
Hi guys...

My problem is that ... I want to display a multi line tooltip text.
As we do in message boxes I tried vbcrlf but didn't succeed


Can any body help?

VB Macro: Keeping Text With Vbcrlf's Tabbed In
Hi, I'm writing a macro to be used in VC++ that takes the selected text (comments only) and formats them a little nicer, including line wrapping at X number of characters. The Line wrapping function takes in a string and a length, and wraps at the end of words according to that length.

The problem is, the function returns a string back to the caller. So after the first line my tabs are lost; nothing is lined up anymore. Any suggestions? I tried using vbcr vblf and vbcrlf and they all lose my tabbing. Any advise would be appreciated, thanks!

C++, where you only show your privates to your friends

Writing To File WITHOUT VbCrLf At End
Hi ppl...

im writing to a text file using the following code, by simple opening the file and writing to it using Print


Code:
Open app.path & "something.txt" for output as #1
Print #1, "Some Data"
Close #1

The prob im having is that this will put a vbCrLf at the end of the last line so that the text file goes onto a new line. I need to be able to print exactly the same but leave the last line without the vbCrLf.

Thanks for any help

Append To File - Vbcrlf Issue
When I Append some text into file then close, VB saves some text and adds at the end new line vbcrlf?
But what if I do not want to add next text into the next row, but continue in the same row as the previous one

How do I do it :
instead of
---- test.txt ---
this is text1
this is text2
this is text3
this is text4

I would like this one
---- test.txt ----
this is text1this is text2this is text3this is text4

all information in one line only.

Parcing Information From Txt File Without Vbcrlf
Private Sub ReadFile()
Dim exceptionlist2 As String

Apppath = "C:"
Apppath = Apppath & "FileExceptions" 'state new directory code should be written to

If Dir$(Apppath, vbDirectory Or vbHidden) = "" Then
MkDir Apppath
End If
'''--------------------------------------------------------------------
'make sure that the form name has not already been written to the file.
'''--------------------------------------------------------------------

Set ts3 = fso3.OpenTextFile(Apppath & "" & "fileexceptions.txt", ForReading, True) 'rewrite to new file
While Not ts3.AtEndOfStream
ExceptionList = ts3.ReadAll
Wend
' ExceptionList = Split(ExceptionList(EOF(1), 1), vbCrLf)
Exit Sub
ts3.Close
Set ts3 = Nothing
DoEvents
End Sub

This code returns the entire list of all information in a text file included the vbcrlf. I need to know how to pass the information to a variable without the vbcrlf so that I can do an instr.

On form load I am reading the information to a variable called exceptionlist which I want to do an instr compare to see if selected information is in the file. If information is not in the file then it will do certain checks, if information is in the file then it will exit the sub and not do checks.

Could I do a split? If so how would I code it.

Any help would be appreciated.

File Reading Problem Characters Like VbCrLf
I found that vbCrLf causes file reading problems, because it thinks it is the next line. That makes perfect sense to me, since I am reading things in line by line. What other things can a user type in that can cause problems? Are tabs a problem in VB? Commas? Non english characters? Symbols?

I am just trying to read a file in as regular text, line by line.

Read & Write File Adding Vbcrlf
I need to read in a file in which some lines have
vbcrlf and some do not. Can I read in and then output
the file with a vbcrlf after every 5 characters? Any help
would be appreciated. I just don't know how to handel a file
that changes from line to line.

Thanks,

Eric



Example of input file:

12345
12345
1234512345123451234512345

Example of Output file should end up looking like:

12345
12345
12345
12345
12345
12345
12345



'module level variables
'file name strings
Dim mstrInputFileName As String
Dim mstrOutputFileName As String

Option Explicit

Private Sub cmdFormat_Click()

Dim strIn As String * 5
Dim strOut As String * 5

mstrinputfilename = "C:ClientIn.txt"
mstroutputfilename = "C:ClientOut.txt"

Open mstrInputFileName For Input As #1
Open mstrOutputFileName For Random As #2

Do While EOF(1) = False
Input #1, strIn
strOut = strIn & vbCrLf
Put #2, , strOut
Loop

End Sub

Text Comparison
Hi all

I have some text to be added in the file .

If this text is present already , I do not want to add.

The text can be same with some extra spaces/tabs or blank lines

then how can I take care of it?

can NE body help me with the code ?

Nahush

Text Comparison
Is there anyway to compare strings so that vb doesn't take accents in account. Ex: =e

Text Comparison
how do i code :-
whether a correct word had been typed into a text box
tink

Text Comparison
I have 2 Memo fields. I want a routine which compares the text in the 2 fields and gives the lines where the difference is and the text of the fields.

Thanks.

Open File In Random Mode - Alignment After Using VbCrLf
I have tried to use vbCrLf during adding the data to the file, but the text file alignment is out. The first line is left justify, but second line and so on are not left justify, the data starts some where in the middle of the line. Any way to solve this problem?

The coding :

Type RecordType
id As String * 2
name As String * 50
End Type

sub WriteToFile()
Dim MyRecord As RecordType
Dim RecordNumber as integer

Open "c: emp estrecord.txt" For Random As #1 Len = Len(MyRecord)

For RecordNumber = 1 To 5
MyRecord.id = RecordNumber
MyRecord.name = "My Name" & RecordNumber & vbCrLf
Put #1, , MyRecord
Next RecordNumber
Close #1
End Sub

How To Determine Constant, Such As VBLf
I hope this is simple for some of you.
I had a problem with some data and I was trying to determine what the hex value was. In a text file, I had vbLf text data instead of vbCrLF codes. I couldn't determine what the code was because all of the conversion routines would fail with 'run-time error 13'.
Even the Hex function failed. I finally found out is was vbLf bystepping through multiple If statements checking for each of the VB constants in the Object Browser Constants description.
So, in the future when I get a run time error 13, I would like to be able to see just what is the hex value of the code that is failing. What utility is available to do this?

Help Getting Started With Text Comparison
Hi all.

Before I get started in the wrong direction, please advise on the most efficient/effective method for this idea.

I have two texts which will be very similar (being 2 translators' translations of a given text). Please don't ask why, but my objective is to seek thru the two texts and find only examples of exact sentences are identical.

I wrote something short and sweet that split the texts into arrays and then just did one array across the other looking for matches.
The place I got stuck was on splitting the arrays. I tried first to split them on a period (full stop). This fails because periods are used in sentences as abbreviations. So I tried to check for doublespaces, but so many people don't doublespace after a sentence. And there was the problem of replacing carriage returns. In the end, the two arrays rarely end up with the same UBound, which is the first indication of a problem. And since there will actually be a group of translators, not just two, it wouldn't be practical to try to force the translators to conform to a specified typing standard. Also it would be impractical to ask them to enter their translations into the system sentence by sentence.

I am just wondering if anybody has done anything that reliably splits text into perfect sentences. Otherwise, better ideas how to do this (in VB)?

Thanks
Wengang

Replacing Vbcr And Vblf With Another Character?
Is it possible to replace vbcr and vblf with another character, if so how? I can't use Instr to locate where those lf's are

Text Box Content Comparison &lt;RESOLVED&gt;
I would like to ask the following question:

Suppose I have three textboxs called Text1, Text2 and Text3
In VB I do the following comparison:


VB Code:
If Text1.Text > Text2.Text Then   Text3.Text = 1Else   Text3.Text = 0End If


The funny situation is that:
When Text1 Textbox contains 50, and Text2 Textbox contains 6
Text3 Textbox output is 1. i.e. 50 < 6 ??
What happened on it?

P.S. I have tried using 2 Combobox as selection input and 1 Textbox as output. It is correct!!

Help Getting Started On A Text-comparison Project
Hey guys.

Before I get started, I was hoping for some input on this idea. My company wants a program that will compare two texts and highlight the differences in one of them. If you haven't seen that before, it is like what Microsoft word will do, merging two documents. So one document is considered to be 100% accurate and the other has its discrepancies highlighted as concisely as possible.

I guess that I could make a brute force comparison algorithm. But...


This is the complicated part. The two documents are English translations of documents that were originally in Chinese. So, the model document, written by a master translator, is used to highlight errors and "score" the junior translator's version. The software doesn't need to do any translation work, but as you can imagine, with two languages, there will always be one-to-many translations for single words, and for expressions. So, I told my boss that it would be virtually impossible, requiring a huge database of interchangeable words and expressions. My boss doesn't think so. So, in his thinking, it would be simply how similar the second doc is to the first. In my thinking, I wouldn't want to highlight the word 'fantastic' if the original translation used 'wonderful'.

Any ideas here before I start digging the tunnel?

Thanks all.
Wengang

File Comparison
Let's say I have two different files, that are simliar. I want to compare the differences between them, then make the first one like the second one.

However, I want people to be able to open up one file (same type as above), and it would make the changes in it, then save it as if it was the second one. Does that make sense? What's a good program to compare the differences?

File Comparison
I have a file where the first half has 3 columns separated by tabs and the second half of the same file has up to 10 columns separated by tabs.

I need to compare this file to another file that has the exact same tabular structure.

What is the best way to do a data comparison for differences and similarities?

Thank You

File Comparison
Hi all

I want to compare two text files

The files can contain same data with some extra spaces/tabs

or some blank lines how can I do it?

Can NE body help me in the code?

Nahush .

File Size Comparison
does anybody know how i can compare the file size of a db file in the root folder of the program and a file on the internet??

Binary File Comparison
I am looking to compare two files on a binary level, to determine if they are identical, regardless of creation date, file name, etc...

Like the DOS FC command.

It does not have to be binary as long as it is accurate.

Is there some easy way to do this or do I realy have to code a bit by bit comparison?

Date Comparison For A File
Hi folks.

I have a program that loops thru a directory picking up files into an array. I then want to be able to select a date from a DTpicker and compare this picked date with the filedate. I have the following structures set up:


VB Code:
Public Type FILETIME  dwLowDateTime     As Long  dwHighDateTime    As LongEnd Type Public Type SYSTEMTIME  wYear As Integer  wMonth As Integer  wDayOfWeek As Integer  wDay As Integer  wHour As Integer  wMinute As Integer  wSecond As Integer  wMilliseconds As IntegerEnd Type Public Type WIN32_FIND_DATA  dwFileAttributes  As Long  ftCreationTime    As FILETIME  ftLastAccessTime  As FILETIME  ftLastWriteTime   As FILETIME  nFileSizeHigh     As Long  nFileSizeLow      As Long  dwReserved0       As Long  dwReserved1       As Long  cFileName         As String * 260  cAlternate        As String * 14End Type


So i have access to the ftCreationtime,the ftLastAccessTime and the ftLastWriteTime but they are not in date format so how do i do a date comparison with the date i chose in the DatePicker?

Thanks a lot

Nice Tip For The File Comparison
Good tip, Frank. I never knew that this was part of Microsoft's OS. In case,
anyone is interested, it is part of NT 4.0 (I just checked)

Once again, thanks!

File Comparison Question
I'm teaching myself VB6. As a first project, I've decided to work on
a Window's version of the Unix command, "diff" -- with a few twists.
But being unfamiliar with VB, I am unsure as to how to best compare
two files and/or directories.

A byte-by-byte comparison would probably be best but slow, correct?
What about computing a CRC for each file and then compare those. any
faster?
OR
Compare file-sizes, and create/access times. Would that be a reliable
enough comparison?

Any thoughts, comments, suggestions, pointers to sample code, etc.
welcome.

Bill W

Re: File Comparison !! { SOLVED 100 % }
Hi,

     How can we compare two files in binary form.

And is it faster to compare two text file in binary form or by reading and comparing their text ????

And I was wondering where the information like date created , modified etc are stored. Does these info is stored inside the file ???

Actually I am making a file comparator.

So when two files which have same data are compared , it can give the % match of data in to files.

But if the info like date created , modified are different , then will it effect the comparison in binary form ????

Thanks in Advance !!


Regards

Er. Gurpreet Singh
C.E.O Sukhmani Software
New Delhi


Difficult Things are Those that can be done Instantly.

Impossible things are those which take little long - Unknown

Edited by - gurpreet2311 on 4/13/2004 1:19:58 PM

File Comparison(with Extension .hex)
hi
can 2 files with the extension .hex be compared if yes then how

Samir
Skill is successfully walking a tightrope over Niagara Falls. Intelligence is not trying.

File Comparison Tool
Hi all,

I've written an applet that will list all the sourcesafe version comments for a particular file (or files). What I now want to do is list all the changes to the file between versions in the following sort of format:-


Filename: MyFile.bas
Version Comment Changes
5 My Comment Added: This line
Changed: That line
Added: Another line
Deleted: Bogus line

4 Some Comment Changed: Very Little



... etc

So, what I need is a file comparison tool with exposed functions that I can access through API. Anyone got any ideas where I can get hold of something like that? Failing that, can anyone point me in the direction of an algorithm that will do the same sort of thing?

------------------------------------------------------------------------------------------------------
The trouble with doing something right the first time is that no one appreciates how difficult it was.

Track File Changes With Binary Comparison
Hi all,

I am developing a Visual Basic 6 Application. This application will run at two different places (offices). This application will be a part of a Document Management System. I have to track the changes made in any stored document in one Office and send those changes to second Office to update the similar document over there. The issue is that I have to send just the changes instead of whole document (similar to a Patch).

There can be different kind of document files. So as and when the user save a document after making the changes, I have to extract the changes through Binary Comparison between the changed file and its earlier copy. Thereafter I have to save the location of changed Bytes along with the actual changed Data (similar to a patch file). After that this file will go to other Office and over there the program will read this file (containing the detail of changes) and update the related document over there. This way the minimum data will be sent between Offices to keep the documents syncronized at both places.

The Binary Comparison is necessary as details for many of the document formats are not available for general public. So I have to track the changes directly from the saved files.

Although Software like WinDiff and many other File Comparison utilities have the option to compare the Text Files and display the difference in an intelligent way, but I am looking for the same functionality for Binary Comparison and also to extract the changes to update them at other end without need to send the whole document.

For example I have to compare two Word documents without using Word or Word Objects. Although the Word documents can still be compared programmatically but then I will not be able to compare many other Document formats (as the details of their format are not available and neither they provide any interfacing with Visual Basic).

Please tell me the best solution for the above. Thanks for your help.

WinDiff Style File Comparison In VB
Has anyone ever written or seen VB source code for showing contents of 2 files side by side and highlighting their differences like WinDiff?

Newbie: Help W/file String Comparison
I am struggling my way through this.

I have 2 files that need to be compared to make sure there are no duplicates in them. The files both contain telephone numbers.

In addition, each file needs to be compared to itself to make sure no duplicates exitst.

So:
1. File #1: look for duplicate telephone numbers.
2. File #2: look for duplicate telephone numbers.
3. Compare File #1 to File #2 to find any duplicates.

The file sizes will be different, and the lines will not line-up. Other posts I have searched for have suggested comparing files sizes, and file1/line1 to file2/line1.

Any help would be greatly appreciated.

The results (the actual duplicate numbers) could be written into another file or written to a label, anything really.

Shane

Database File Comparison &amp; Export
Help me.

i'm not a programmer but i have a reasonable knowledge base here. What i dont know is what i want to say in technical terms, so bare with me. Part of the help i could use is in the correct terminology for what i am looking for.

I own a pharmacy. From our distributor, we can receive files with our orders & our invoices (2 files). How the heck do i work with them? I would imagine, if i knew the database structure, i could treat both files as a table, then i could compare the contents of the two tables as i see fit.

as for VB purposes, i envision a program that will have a few buttons, one to select order file, the other to select invoice file, one to "Go" or compare. I would probably want some sort of a "database structure template" selection tool, in the event that i have multiple vendors or the file structure changes?

The next step would be to take this "invoice" file, which is our newly ordered products and add to a 3rd party software table. I would again, have to know the structure of that table, then basically line by line go through the invoice and add the quantity of that item to the corresponding entry in the invoice table.

Is this a difficult process?

thanks!

WinDiff Style File Comparison In VB
Has anyone ever written or seen VB source code for showing contents of 2 files side by side and highlighting their differences like WinDiff?

WinDiff Style File Comparison
Has anyone ever attempted or seen VB source code for displaying/comparing the contents of two files and highlighting the differences? Haven't been too successful searching for code samples of this.

Copyright 2005-08 www.BigResource.com, All rights reserved