VFP2Text v3

by Frank Perez May 26, 2014

Back in 2008 the first version of VFP2Text was initially released. I was immediately surprised by how many people liked it. Sometimes an idea seems really cool to you, but it's hard to gauge what others will think.

For the sake of those who are new, Beyond Compare is a tool for comparing folders and files. VFP2Text is an add-on utility for Beyond Compare that allows Beyond Compare to perform comparisons on Microsoft FoxPro binary files (DBC, DBF, FRX, SCX, and VCX).

Three years later, VFP2Text v2 was released which added support for Beyond Compare v3 and a couple of minor adjustments. At that time I attempted to add Merge capabilities, but I was never able to get it to work well. Which explains why I never blogged about VFP2Text v2.

After six years of near silence, I'm proud to release the next major version of VFP2Text with some very cool features.

  • Installation Program
  • Update Beyond Compare Settings
  • Human Readable
  • Deleted Records
  • Caching
  • Digitally Signed

Installation Program

VFP2Text now includes a real installation program. The installation program will automatically locate the folder where Beyond Compare is installed and then install VFP2Text into a sub-folder.

Update Beyond Compare Settings

VFP2Text can now automatically update the Beyond Compare File Formats. This simplifies the setup process and makes getting started with VFP2Text easier.

Human Readable

The previous versions of VFP2Text used the CURSORTOXML() function to convert FoxPro binaries to XML. XML was chosen because it is very easy and fast to create, and XML automatically handled MEMO fields.

One of the problems with the XML format is that Table Structure was very verbose and difficult to read.

Another problem with the XML format is that it converted special characters, such as the lessor than and greater than signs.

VFP2Text v3 manually converts every field to plain text in a custom format that is easier to read.

VFP2Text v3 includes the entire table structure (code page, fields, indexes, database name, and etc).

VFP2Text v3 automatically handles special characters.

Deleted Records

The previous versions of VFP2Text ignored deleted records. This made sense for FoxPro source code (e.g. FRX, SCX, and VCX) files, but was not always the desired behaviour for DBF files.

VFP2Text v3 includes deleted records when DBF files are processed.


FoxPro binary files mostly come in pairs. For example, a Report consists of a FRX and a FRT file, whereas a Form consists of a SCX file and a SCT file. Because there is no way for VFP2Text to know which file in a pair will get passed to it (sometimes both, sometimes just one), VFP2Text has to perform the conversion process for either file in a set. That is why the File Formats has multiple extensions.

VFP2Text v3 saves time by caching the last 30 seconds of conversions. For example, once the CDX has been converted to plain text, VFP2Text uses the cache for the corresponding DBF and FPT files.

Digitally Signed

The VFP2Text.EXE and Setup*.EXE files are now digitally signed.

Download VFP2Text http://pfsolutions-mi.com/Product/VFP2Text
Scooter Software Beyond Compare http://www.scootersoftware.com/


Filed Under: VFP | VFP2Text

VFP2Text Source Code

by Frank Perez April 15, 2008

Ever since I decided to post the Beyond Compare add-on utility, VFP2Text, it was always my intention to also release the source code. The reason I waited was to allow some time for any bug reports or major enhancement ideas. I figured initially it would be easier for me to handle them.

Well, it's been over a month since I first blogged about the add-on and so far no problems reported and the enhancement requests have been about minor changes. So, in keeping with my original plan, I have posted the source code for the utility on my web site http://pfsolutions-mi.com/Product/VFP2Text.

In return, I ask that you please share with me any cool enhancements or bugs you find. Thanks.


Filed Under: VFP | VFP2Text

Beyond Compare

by Frank Perez March 8, 2008

Beyond Compare is one of my favorite developer utilities. It's a tool for comparing folders, files, and folder like things such as ZIP and CAB files. It can detect differences using several methods, such as the timestamp, size, CRC, attributes, and more.

Once two files are identified as not identical, you can drill down into the contents and see exactly what is different line by line using Beyond Compare's File Viewer.

This feature is cool, however the native file viewer only supports text files such as HTML, TXT, XML, and so on. If you try to compare a binary file, you get something that looks like this.

I checked Beyond Compare's web site and found several plug-ins for viewing other binary files like BMP, GIF, JPG, and MP3. Hmm, not what I was looking for, but could be a handy thing to have in the future.

I looked around a little more and I found some file viewer rules for handling binary files like DOC, XLS, and PDF. Once again, not what I needed, but I would probably need some day.

So I decided to download a few of these and what I found is that the file viewer rules use Beyond Compare's capability to launch an external conversion program before a file is passed to it's native file viewer. For example, the DOC rule uses a Visual Basic Script (VBS) to automate Microsoft Word, open the passed DOC file, and then save a copy of it to a temporary text file. This temporary file is then passed to Beyond Compare's internal File Viewer for the line by line comparison.

Bingo! If Beyond Compare can call an external conversion program, why not write something that converts FoxPro files to plain text files. And thus VFP2TEXT was created.

Here's how it works. I created a file viewer rule in Beyond Compare for all FoxPro related file types (CDX, DBC, DBF, DCT, DCX, FPT, FRT, FRX, FXP, H, LBT, LBX, MNT, MNX, MPR, MPX, PJT, PJX, PRG, QPR, SCT, SCX, VCT, VCX). This rule calls executes VFP2TEXT.EXE passing both the original file name and a temporary file name.

Based on the file type, the VFP2TEXT.EXE program converts the passed file to a text file using one of the following methods:

  • Index (CDX, DCX): retrieve the index tag information only.
  • Table (DBF, DBC, FRX, SCX, etc): use the CURSORTOXML() function to generate an XML file.
  • Text (H, MPR, PRG, etc): no conversion.
  • Visual Class Library (VCX): use the Class Browser View Code feature to generate a PRG file.

If you would like a copy of this application, you can download the latest version from http://pfsolutions-mi.com/Product/VFP2Text. When using it, there are a couple of things to keep in mind:

  • Beyond Compare will execute the conversion program twice, once for the file on the left and once for the file on the right.
  • Be careful about doing a Rules-Based Comparison on a large directory. I prefer to use the Binary Comparison first, and then use a Rules-Based Comparison on the results.

Beyond Compare http://www.scootersoftware.com/


Filed Under: VFP | VFP2Text

About Frank

Frank lives in West Bloomfield, Michigan with his wife and three children.  When he is not writing code, he enjoys long distance running and riding his motorcycle.

Month List

Tag Cloud