in reply to Re^2: Searching a pattern's first and last occurrence in a file.
in thread Searching a pattern's first and last occurrence in a file.

is there any way to search a file for a string bottom up?

There are ways, but unless your file(s) are so big that you cannot fit them in memory(?), I wouldn't bother because they are horribly inefficient.

Secondly how do i search ABCXXX where xxx could be Jan Feb...... Dec

Use regex.


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".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^3: Searching a pattern's first and last occurrence in a file.

Replies are listed 'Best First'.
Re^4: Searching a pattern's first and last occurrence in a file.
by ankurk (Initiate) on Oct 19, 2013 at 17:51 UTC
    Actually i need to search html tag like <XXX>Jan or <XXX>Feb ... and so on. Not getting the desired results.
      Actually i need to search html tag like <XXX>Jan or <XXX>Feb

      Hm. Each time you post, the target changes:

      1. searches for a particular pattern's(Oct-18-2013)
      2. ABCXXX where xxx could be Jan Feb...... Dec
      3. <XXX>Jan or <XXX>Feb </i?
      Not getting the desired results

      Oh. So what are you getting? And how does that differ from your desires? And how are you doing it?

      Try .... something different. That's the best I can come up with given the complete lack of information you've provided. Good luck.


      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".
      In the absence of evidence, opinion is indistinguishable from prejudice.
Re^4: Searching a pattern's first and last occurrence in a file.
by ankurk (Initiate) on Oct 20, 2013 at 13:24 UTC
    Thanks for your help... Took me some time to troubleshoot. But finally getting the required results.

    Cheers

    Ankur