Loading ...
Sorry, an error occurred while loading the content.

Need help on extracting records !

Expand Messages
  • eventualdeath
    Hello, I need members help on this:- I wish to search a html guestbook for a particular word lets say Jim and if the word Jim is found , to display the records
    Message 1 of 1 , Nov 1, 2001
    • 0 Attachment
      Hello,
       
      I need members help on this:-
       
      I wish to search a html guestbook for a particular word lets say Jim and if the word Jim is found , to display the records that contain the word Jim. The format of the guestbook is seperated by a horizontal line & it goes something like this :-
       
      Name : Jim-could-be-here     Age = their-age
      Location :
      Remarks : their remarks .....

      Name : whatevername     Age = their-age
      Location :
      Remarks : Jim-could-be-here-also    
      and many more similar entries.....
       
      #######################
      This is what I've tried but it still prints everything :-
       
      open (FILE, "frall.html")||  die"file not found $!\n";
      @read = <FILE>;
      chomp @read;
      # but it still could not get rid of the new-line (I dont know why?)
      join ('<hr>\n', split(/<hr>/, @read));
      foreach $record (@read){
          if (grep /jim/, $record) {
             print $record;
          };
      };
       
    Your message has been successfully submitted and would be delivered to recipients shortly.