shalgham has asked for the wisdom of the Perl Monks concerning the following question:
I have an array and a file, the file is tabulated file with column and rows. I want to search each memeber of the array and if it exists in the header of the file then I want to print the whole rows under it and each member of the array is from letter not numbers
I do not know how to do it. I have an array of some letters like @a=(nat,pls,kac). and I have a table with as " nat\t pls\t fof\t tri\t kac " and I want to get all the rows of the column that match the member in my array. for example, I need rows that has nat,pls,kac as header but discard fof tri column.foreach my$t(@array){ ## if it is eq to one each header print the lines under that header + plus the header itself##
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: searching an array member in file header and print a column
by kcott (Archbishop) on May 27, 2014 at 13:09 UTC | |
by shalgham (Initiate) on May 27, 2014 at 13:17 UTC | |
|
Re: searching an array member in file header and print a column
by InfiniteSilence (Curate) on May 27, 2014 at 15:05 UTC | |
by shalgham (Initiate) on May 27, 2014 at 15:47 UTC | |
|
Re: searching an array member in file header and print a column
by 2teez (Vicar) on May 27, 2014 at 19:54 UTC |