in reply to Insert a meter only once

The best way for us to help is if you post the smallest code example that we can run and which also demonstrates the problem you have. Make sure to also post the output you get and the output you expect. Use "code" tags: read Writeup Formatting Tips. See also http://sscce.org

Replies are listed 'Best First'.
Re^2: Insert a meter only once
by AnomalousMonk (Archbishop) on Nov 20, 2015 at 17:23 UTC

    Further to toolic's post: I have no idea what the word meter means in the context of the OP. The only application to written text I can think of has to do with poetry (see the linked word definitions). Is "meter" in your context something like a "metric", a "measure", perhaps a "total count"? A short, executable example might clarify this.

    Update: Oops... Meant to reply to JabberJay58 in the main thread, not to toolic. Oh, well...


    Give a man a fish:  <%-{-{-{-<

      Well 'compteur' in French means 'counter' (as in 'compteur de mots' = 'word counter').

      But 'compteur' also means 'meter', as in electricity/gas meter, or the meter in a taxi.

      So I guess the OP is really looking to count distinct words in a text.

        Perhaps JabberJay58 wants a list of the words used in a file and number of times each is used. This can be done by storing the words as the keys of a hash and keeping the counts in the corresponding values.
        Bill