CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2008
    Location
    St. Petersburg, FL
    Posts
    3

    Need Advise: How to store procedural steps.

    I hope someone can give me a bit of help.
    This is one of the most complicated projects I have ever been given and I need some advise on how to store procedural steps -- for each customer.

    Our company receives over a period of a month about 2000 data files provided by the customers and the project is to validate each file before sending them on for further processing. Each of the files sent by the customer has a similar format, but they are not exactly the same.

    There are two types of files, Fixed Length and Variable length files. The file extension tells you what files type you have.
    However, in the fixed length, there are 6 different lengths. It is the size of each field that makes them different. Some of the validations are simple. Date has format MM/DD/YYYY and that can be a regular expression. Other validations are not so simple, like Field 4 for customer "ABC Company" is the total amount issued to their client. But for "XYZ Industries", it's Field 5 which is the Check Amount issued to the client. Each company can have a different field to check or a different value to be validated.

    Here's my question: Each customer is going to require their own procedural steps or set of validation constants, how do I store this?

    What I have come up with is this:
    >The validation detail files would all be xml files for each of the customer's reports.
    >An SQL Server table will be the master table telling the program which xml file to grab for that incomming file.
    >Since they all the customers basically have the same format, each xml file would have all 50 fields laid out.
    >Only the xml nodes with text values would be those that are validated, either by regular expressions or actual values.

    So far not too bad? Now add the Variable length files to this....

    Certain fields within the file are unlimited or nearly unlimited in size and are delimited with a "|" between each value. I may have to check each of the values in that field to see if it is a proper street address format or something like that. And that's only in the first record.

    Ouch! my head hurts just thinking about it.
    Any help that anyone can give will be deeply appreciated.
    Frank
    Thank you.
    Frank G.

  2. #2
    Join Date
    Nov 2010
    Posts
    34

    Re: Need Advise: How to store procedural steps.

    Why not just skip all the extra stuff and make a base parsing program to feed a data file into arrays/lists, and then write smaller executables to read each file?
    You could put a marker in the filename via the parser, then route each file to the appropriate .exe.
    This would also make it easy to implement "multi-threading" without dealing with threading in one application.... /shrug

    Otherwise if you really want something dynamic, just parse and then write to a txt different C# procedural steps needed for that specific data file. Then when the txt is ready to be compiled, call the command line compiler on the txt, and then run that unique procedurally correct exe against the data file (or parsed data file).

    Hope this helps in some way

  3. #3
    Join Date
    Dec 2007
    Posts
    234

    Re: Need Advise: How to store procedural steps.

    Here's how I've done it: a SQL table to act as a staging area. Custom import processes for the different files. Each of the importers dumps the data into the SQL Table. Once all of the data is imported, run a data scrub routine... sometimes a simple Stored Proc will work, sometimes it means writing code. Once the data in the table has been scrubed and validated... then another process takes the valid records and moves them to the final location(s) in the database.

    -tg
    * I don't respond to private requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help - how to remove eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to???
    * On Error Resume Next is error ignoring, not error handling(tm). * Use Offensive Programming, not Defensive Programming.
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN
    MVP '06-'10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured