HI Dave-

You ask good questions. Disregard my earlier code because it was using the wrong variable to search with (I think that's correct?)

What I am wanting is to find out how many times the long "exe" strings appear in a file. Then print each result with a name for the string rather than the string itself. Eg:

C:\Program Files\Internet Explorer\IEXPLORE.EXE

in:

3/15/2004,2:29:31 PM,Security,Success Audit,Object Access ,560,SERVER\ +refterm,SERVER,"Object Open: Object Server: Security Object Type: File Object Name: C:\Program Files\Internet Explorer\IEXPLORE.EXE New Handle ID: 548 Operation ID: {0,178005108}

Result:

Name: Explorer Count: 1

It seems I was walking down the wrong path and will have to use regex (which I have not yet read about, in all honesty) to search for the exe string within each line of text. The 'crime', 'crimean' issue is not a problem because there are no variants of the strings I'd be counting. There are MANY paragraphs like the one above in the file to be searched.

If you have any ideas what this code might look like feel free to offer it :-) I will learn as much on my own in the meantime!

Regards,

Sam


In reply to Re: Re: Re: Help - Counting text - Associative Array? (I was Annon Monk) by Mr_Lowry
in thread Help - Counting text - Associative Array? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.