I've been talking about rewriting the File Viewer application I developed at Communisis back in the early naughties for some time now. It took a while for me to find a solution for opening very large files (>20GB) that I liked and a virtual grid that would allow me to view them.
After being (almost) forced to learn Java I thought it might hold the key. It can certainly handle the large files easily enough and
JTable
is certainly virtual enough to view them. I got quite a long way down the Java route before I decided Swing didn't give me the most aesthetic of GUIs and layout managers were too much like hard work (I've since got to grips with layout managers and changed my mind about them to some extent).I started looking around for a virtual grid for C#. I already knew that C# could handle the file sizes without any problem from the testing I'd done a few years back. It was pointed out to me that the
DataGrid
has a virtual mode and a little bit of playing about soon showed me that it was ideal for the task. Moving to C# would loose some of the platform independence I've always strived for, but the better looking GUI and the interest shown by some people who might actually use it in a C# version were overwhelming.I ported my MVC design directly to C# from Java taking advantage of some of the better features in C#, such as properties and events and I now have a working prototype that allows the user to open and view fixed length record files using an xml layout to describe the fields:
<layout>
<field name="Id" length="20">
<field name="Number" length="20">
<field name="Add1" length="20">
<field name="Add2" length="20">
<field name="Add3" length="20">
<field name="Postcode" length="20">
<field name="CR" length="1">
</field>
This is the current limit of the features. There is no way of saving or reloading projects (a project consists of a layout and datafile), no search or reporting and no way of creating or modifying layouts. This is strictly a prototype to prove the concept.
Marauder File Viewer can be download here (You'll need .Net 2 if you don't already have it). After unzipping double click FileViewer.Exe to run file viewer. To test it:
- Go to the Help menu and select Create Test Files to create a set of three test files and a layout file in the same location as the exe.
- Go to the File menu and select New Project.
- Double click the Fixed Length icon from the New Project dialog.
- Click the first browse button and navigate to
test1.txt
to set the file. - Click the second browse button and navigate to
lay.xml
to set the layout. - Click create to load the file and layout.
- Repeat steps 2 to 6 for
test2.txt
andtest3.txt
.
You can now use the tabs to switch between the test files and the vertical scroll bars to scroll through their content. The Marauder File Viewer will work with any fixed length record text file and any xml layout that uses the format shown above.
The next steps in development will be:
- Support for RDF layouts
- Allow the saving and opening of projects.
- Searching
- Fixed length record file layout creator and modifier
- Further development plugin facility to allow other file types to be viewed
Works quite nicely with Mono, so the platform independence issue is not so much of a biggy!
ReplyDeleteThat's good to know, thanks! I assume you tried it on a Mac? I'm hoping to try it on Linux soon.
ReplyDeleteAny chance you may release the source code?
ReplyDeleteIt is highly unlikely that I'll be releasing the source code, but let's talk about the application you have in mind (paul.grenyer@gmail.com).
ReplyDeleteI now have the plugin architecture working and have nearly got the the project interface complete, so you could start writing your own plugins.
Like I said, let's talk...