you really gave too little information, so may Text::Diff or
Algorithm::Diff be helpful for you. if not,
you have to describe how your file(s) look like. | [reply] |
| [reply] [d/l] |
the desires output is to have the exact name of the
module : net : and gate where the change has taken place.
What change? Without knowing which values you are trying
to compare, I can't offer a complete solution.
Ah, you have two files that you want to compare. Ok.
So you turn each one into a data structure, then iterate
over one, and report differences against the other.
Just turning the format you give into a data structure
is easy. Although, if the actual input is as large as
you say it is, note that this might not be the right
answer. If this simulation takes a substantial part of
your computer's memory when done in C, trying to create
a Perl data structure for the entire output will likely
fail. Picking just certain gates should be ok, though.
Here's the basic pattern you want to follow. Each
line is either introducing a new thing to describe,
or it is continuing the description of the most
recently introduced thing. Either way, we store the
description in a data structure (potentially creating
a new "slot" if it is a new thing being introduced.)
| [reply] [d/l] [select] |
This really depends on what data you are trying to parse and how it is encoded.
It would be helpful if we knew more, a file specification would be nice ;) about what the data is and why you need the changes.
If you have no specification as to how the data is stored you will run into trouble interpreting significant and non significant changes.
ie. databases often store numbers to indicate the length of a string in bytes. If you don't know that then interpreting the following data is very difficult.
If your data is compressed in any way then it is only worthwhile doing the comparision after decompression otherwise the results are meaningless. If you don't know the compession method you are at a distinct disadvantage, i.e. cracking an unknown compression algorithom is similar to doing cryptographic analysis and is not simple.
Hope it helps
UnderMine
| [reply] |
Step 1: Learn Perl.
Step 2: Define problem.
Step 3: Write code to solve problem.
Step 4: Test code.
Step 5: Write code to fix issues found by testing.
Step 6: Go to Step 4. | [reply] |