in reply to Replace table values from text database

My problem is that the replacements are not done correctly and I end up with a table full of replicated values that don't correspond to the original.

Does the set of replacement names overlap with the set of original names?

(And, on the face of it, processing the whole file completely to perform each substitution is a nuts way to approach the problem. Horribly inefficient, when the whole process can be done in a single pass.)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Replace table values from text database

Replies are listed 'Best First'.
Re^2: Replace table values from text database
by Alfumao (Initiate) on Mar 14, 2016 at 14:18 UTC
    (And, on the face of it, processing the whole file completely to perform each substitution is a nuts wayto approach the problem. Horribly inefficient, when the whole process can be done in a single pass.)

    I totally agree, but I do not know how to achieve such thing. Would you please show/link an example I can use to figure out how to do it?

    Thanks in advance

      Sure. If you answer my question?

      And, as requested elsewhere, post some real data: inputs and expected output. It only need be a dozen lines of each file; preferably that connect with each other.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Sorry, for not answering your question.

        Does the set of replacement names overlap with the set of original names?

        I think both sets of names do not overlap. You can see the example data I posted and tell me if you think different.

        Thanks again.

        *Update*

        You were right, after a few records, names may overlap e.g.(A_fumigatus_1 overlaps A_fumigatus_10 or A_fumigatus_17).

        So I guess that is the main source of error during translation.