PC Review


Reply
Thread Tools Rate Thread

Data Records Formats Testing Tool

 
 
Mark Jerde
Guest
Posts: n/a
 
      12th Jan 2005
(If these are the wrong groups please suggest the right one(s). Thanks.)

I need to come up with a way to test potentially thousands of data (files /
records / streams) to determine if they match one of about thirty defined
data formats. If a record partially matches one of the formats I need to
log why it failed.

The formats are byte-oriented. Byte 0 is the type, byte 1 is the subtype,
bytes 2-5 give the total record length, etc. There are two wrinkles.
First, some of the formats allow 1..n subrecords, like a person listing her
home phone, cell phone, fax number, ICQ #, the dog's cell phone, etc.
Second, some of the formats allow other formats to be wholly contained in
them, like an "inventory" format being made up of many separate items of
different "item" format types.

In the history of computers this *can't* be the first need for this kind of
program. ;-) New formats are approved periodically so hard-coding
everything in C# or VB.NET is a sub-optimal solution. ISTM it should be
possible write the permissible format "rules" in (XML / ASN.1 / RegEx /
etc.), present the rules to a tried and true program, and smash data files
against the program all day long.

Suggestions? Windows preferred but not required.

Thanks.

-- Mark


 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      12th Jan 2005
Hi,

Convert the stream to a string and use an regular expressions to
match the format. Not sure how you will be able to tell if the phone number
is a home number, fax, or dog's cell phone.

http://msdn.microsoft.com/library/de...xpressions.asp

Library of regular expressions.
http://www.regexlib.com/


Ken
-------------------------
"Mark Jerde" <(E-Mail Removed)> wrote in message
news:ueXfu3K%(E-Mail Removed)...
(If these are the wrong groups please suggest the right one(s). Thanks.)

I need to come up with a way to test potentially thousands of data (files /
records / streams) to determine if they match one of about thirty defined
data formats. If a record partially matches one of the formats I need to
log why it failed.

The formats are byte-oriented. Byte 0 is the type, byte 1 is the subtype,
bytes 2-5 give the total record length, etc. There are two wrinkles.
First, some of the formats allow 1..n subrecords, like a person listing her
home phone, cell phone, fax number, ICQ #, the dog's cell phone, etc.
Second, some of the formats allow other formats to be wholly contained in
them, like an "inventory" format being made up of many separate items of
different "item" format types.

In the history of computers this *can't* be the first need for this kind of
program. ;-) New formats are approved periodically so hard-coding
everything in C# or VB.NET is a sub-optimal solution. ISTM it should be
possible write the permissible format "rules" in (XML / ASN.1 / RegEx /
etc.), present the rules to a tried and true program, and smash data files
against the program all day long.

Suggestions? Windows preferred but not required.

Thanks.

-- Mark



 
Reply With Quote
 
Mark Jerde
Guest
Posts: n/a
 
      12th Jan 2005
Ken Tucker [MVP] wrote:
> Hi,
>
> Convert the stream to a string and use an regular expressions
> to match the format.


Thanks, I'll look into this if we decide to write something. I don't know
much about regular expressions yet but I'm concerned about the calculated
offsets and regex complexity (and validation). See the phones example
below.

There are some advantages for this project to use a commercial or open
source product. A "drag & drop" interface like Visio would be ideal.

> Not sure how you will be able to tell if the
> phone number is a home number, fax, or dog's cell phone.


(My addition may be off...)
Byte 10 - Length of the phone text description
Bytes 11 to 11+(val(Byte10-1)) - Phone text description
Byte 11+(val(Byte10)) - Length of phone number
Bytes (11+(val(Byte10))) to (11+(val(Byte10)))+(val(11+(val(Byte10)))-1) -
Phone number

-- Mark


>

http://msdn.microsoft.com/library/de...xpressions.asp
>
> Library of regular expressions.
> http://www.regexlib.com/
>
>
> Ken
> -------------------------
> "Mark Jerde" <(E-Mail Removed)> wrote in message
> news:ueXfu3K%(E-Mail Removed)...
> (If these are the wrong groups please suggest the right one(s).
> Thanks.)
>
> I need to come up with a way to test potentially thousands of data
> (files / records / streams) to determine if they match one of about
> thirty defined data formats. If a record partially matches one of
> the formats I need to log why it failed.
>
> The formats are byte-oriented. Byte 0 is the type, byte 1 is the
> subtype, bytes 2-5 give the total record length, etc. There are two
> wrinkles. First, some of the formats allow 1..n subrecords, like a
> person listing her home phone, cell phone, fax number, ICQ #, the
> dog's cell phone, etc. Second, some of the formats allow other
> formats to be wholly contained in them, like an "inventory" format
> being made up of many separate items of different "item" format types.
>
> In the history of computers this *can't* be the first need for this
> kind of program. ;-) New formats are approved periodically so
> hard-coding everything in C# or VB.NET is a sub-optimal solution.
> ISTM it should be possible write the permissible format "rules" in
> (XML / ASN.1 / RegEx / etc.), present the rules to a tried and true
> program, and smash data files against the program all day long.
>
> Suggestions? Windows preferred but not required.
>
> Thanks.
>
> -- Mark



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Network testing tool Taffycat General Discussion 5 25th Jan 2010 11:11 PM
Decent HDD testing tool? Zeno Storage Devices 4 22nd Jul 2009 05:37 AM
What RegEx Testing Tool Do You Use? clintonG Microsoft C# .NET 7 10th Oct 2005 08:21 PM
Problem with C# Testing tool James dean Microsoft C# .NET 2 4th Mar 2005 12:59 AM
Data Records Formats Testing Tool Mark Jerde Microsoft VB .NET 2 12th Jan 2005 02:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:19 AM.