G'day neeraj_kr,
Welcome to the Monastery.
Your posted question is lacking important information. You do not show: sample input; actual output; expected output; or, warning or error messages. Saying "it's not working properly" is a pretty much useless error report: would you take a car to a mechanic, provide just that information, then walk away? Please read "How do I post a question effectively?".
Your code, in general, leaves much to be desired. I'd recommend, in the first instance, that you read "perlintro -- Perl introduction for beginners". When you've done that, apply what you've learned and rewrite your code. Some areas that stand out as needing attention, include:
Your @arr1 array, with what looks like a couple of hundred elements, is fairly pointless. What is this supposed to tell us? Is there any sort of order or pattern to this data? Did you expect us to analyse this for you (without the benefit of your domain-specific knowledge)? Pick a discrete sample of representative data for your SSCCE.
There are two general approaches to what you want to do. Without any knowledge of your input data, I'm not in a position to advise which might be best, or how you would implement it. One method involves storing your keywords in a hash then using exists; the other uses regular expression alternations (see perlre; although, you might want to look at perlretut first).
Your "@arr2=split(/\,/,$_);" line of code suggests you're reading CSV data. Use Text::CSV for this; if you also have Text::CSV_XS installed, it will run faster.
That's a lot of reading, things to fix, and additional information to provide. Once completed, you may have additional questions: please post these with this thread (not as new, separate questions).
— Ken
In reply to Re: Data extraction with specific keywords
by kcott
in thread Data extraction with specific keywords
by neeraj_kr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |