none
Import VBA Script for Complex ASCII File RRS feed

  • Question

  • All,

    I'm relatively new to MS Access, though I have used VBA in Excel 2007 in the past and I am a proficient coder in several languages.

    My situation is that I have a pair of similar, but slightly different text files that detail an electronic circuit, and I need to reconcile the differences.  As these files are setup similarly, there is enough of a difference between the two that importing to a database seemed like the most practical route.

    Each line, if the end of the previous line does NOT have a comma at the end, is a new line of data.  There are different sections delimited by a $Statement, such as $PACKAGES or $NETS.  The format of each line changes between the different sections, and the text files are netlists for electronic design programs.  In the $PACKAGES section, the format is:

    Footprint ! Part_Number ! Value ! Tolerance ; REFDES1 REFDES2 REFDES3 ,
            REFDES4 REFDES5 REFDES6 REFDES7 REFDES8 REFDES9 ,
            REFDES10 REFDES11 REFDES12

    In the $NETS section, the format is below, where REFDES1.2 would mean Pin 2 of REFDES1:

    Net_Name1 ; REFDES1.1 REFDES3.2 ,
            REFDES2.8
    Net_Name2 ; REFDES4.3 REFDES6.2

    I'd like to import the file such that it is all referenced by the REFDES (Reference Designator), which for a schematic is like R11 for Resistor 11 on the board.  I need to correlate the pins to the Net_Name that they are associated with for each REFDES.  I'm going to do this for two TXT files and then compare them to see where they are different.  For example, is pin REFDES1.1 and REFDES1.2 going to Net_Names Net_Name1 and Net_Name2, respectively in one file, but maybe reversed in the other.  I have a good idea how the data will be setup, but in my minds eye I'm thinking of a data struct from c++, where there may be other struct's the feed into the final struct.  Help on importing is appreciated.

    Wednesday, October 8, 2014 9:02 PM

All replies

  • Why don't you use a program like winmerge (free), ultracompare or examdiff ?

    Winmerge site seems to be down right now though.

    http://www.winmerge.org

    http://www.prestosoft.com/edp_examdiff.asp

    If you need source countrol and change tracking you should look at something like GIT or SVN.

    Microsoft offers TFS Online that you could use for free if you're just a single user (up to 5 users allowed) if you don't mind uploading your code.


    "If there's nothing wrong with me, maybe there's something wrong with the universe!"

    Wednesday, October 8, 2014 9:24 PM