Sponsored Content
Top Forums Shell Programming and Scripting Perl Data Structure - Non unique values Post 302410963 by dinjo_jo on Wednesday 7th of April 2010 11:15:58 PM
Old 04-08-2010
Perl Data Structure - Non unique values

I have the perl data structure and what i need to do is find all values in
@{$extractColumns{'2'}{'D'}} which are not there in @{$extractColumns{'2'}{'M'}} but seems like i need to put a flag somewhere and i messed up

Code:
foreach my $order (keys %extractColumns)
{
        foreach my $value (@{$extractColumns{'2'}{'D'}})
        {
                foreach my $detValue (@{$extractColumns{'2'}{'M'}})
                        {
                                chomp($value);
                                chomp($detValue);
                                if ( $value eq $detValue )
                                {      
                                        print "Found\n";
                                }
                                else
                                {
                                    print "Not Found\n";                             
                                }
                        }
                }
        }



---------- Post updated 04-08-10 at 08:45 AM ---------- Previous update was 04-07-10 at 06:37 PM ----------

Anyone ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to retrieve unique values

Hi all, I have a 10.txt file. In this file 2 words are present by name Active and Inactive and these words are repeated 7000 times. I want to take the unique 2 words from this 7000 lines. Thanks Mahalakshmi.A (3 Replies)
Discussion started by: mahalakshmi
3 Replies

2. Programming

Search attributes in one structure using the values from another structure

Hello Groups I am trying to find out ways of comparing a value from a 'c' structure to a value in another 'C' structure. the 'C' structure can be a List or liked list as it contains lot many records. if we loop it in both the structures it is going to consume time. I am looking for a simple... (3 Replies)
Discussion started by: dhanamurthy
3 Replies

3. Shell Programming and Scripting

Getting Unique values in a file

Hi, I have a file like this: Some_String_Here 123 123 123 321 321 321 3432 3221 557 886 321 321 I would like to find only the unique values in the files and get the following output: Some_String_Here 123 321 3432 3221 557 886 I am trying to get this done using awk. Can someone please... (5 Replies)
Discussion started by: Legend986
5 Replies

4. Shell Programming and Scripting

unique storage structure in ksh

hi all, is there a storage structure in ksh which only allows unique values i.e overwrites duplicates values ?? am using an array to hold server names from a 'find' command but some of the names are repeated. Is there an easy way to remove the duplicates ?? ta. (2 Replies)
Discussion started by: cesarNZ
2 Replies

5. Shell Programming and Scripting

perl-extract data from hash values

Hello, I have parsed an xml file using perl to get the hash values and the output looks like this $VAR1 = { 'RT' => { 'List' => { 'String' => ... (1 Reply)
Discussion started by: userscript
1 Replies

6. Shell Programming and Scripting

perl data structure

Hi All, I want to create a data structure like this $VAR1 = { 'testsuite' => { 'DHCP' => { 'failures' => '0', 'errors' => '0', 'time' =>... (3 Replies)
Discussion started by: Damon_Qu
3 Replies

7. Shell Programming and Scripting

AWK, Perl or Shell? Unique strings and their maximum values from 3 column data file

I have a file containing data like so: 2012-01-02 GREEN 4 2012-01-02 GREEN 6 2012-01-02 GREEN 7 2012-01-02 BLUE 4 2012-01-02 BLUE 3 2012-01-02 GREEN 4 2012-01-02 RED 4 2012-01-02 RED 8 2012-01-02 GREEN 4 2012-01-02 YELLOW 5 2012-01-02 YELLOW 2 I can't always predict what the... (4 Replies)
Discussion started by: rich@ardz
4 Replies

8. Shell Programming and Scripting

Finding unique values in a hash (Perl)

Hi, I have a hash with unique keys associated with some data. my %FINALcontigs = ( 'mira_rep_c765:119reads**', 'ctctactggaagactgac', 'mira_rep_c7454:54reads**', 'atggatactgcgctgttgctaactactgga', 'mira_rep_c6803:12reads**', 'atcgactggatgcagggttgtggtttcta', ... (2 Replies)
Discussion started by: jdilts
2 Replies

9. Programming

Sctp api name to retrieve the values of structure sctpassoctable

Hi i want a sctp (lksctp) api which can retrieve the values of the sctp structure "sctpAssocTable" It is sctpassoctable or sctpassocentry. SctpAssocEntry ::= SEQUENCE { sctpAssocId Unsigned32, sctpAssocRemHostName OCTET STRING, sctpAssocLocalPort ... (1 Reply)
Discussion started by: harioum
1 Replies

10. Shell Programming and Scripting

Perl :: reading values from Data Dumper reference in Perl

Hi all, I have written a perl code and stored the data into Data structure using Data::Dumper module. But not sure how to retreive the data from the Data::Dumper. Eg. Based on the key value( Here CRYPTO-6-IKMP_MODE_FAILURE I should be able to access the internal hash elements(keys) ... (1 Reply)
Discussion started by: scriptscript
1 Replies
PPI::Structure::Unknown(3)				User Contributed Perl Documentation				PPI::Structure::Unknown(3)

NAME
PPI::Structure::Unknown - An unknown or unresolved brace structure INHERITANCE
PPI::Structure::Unknown isa PPI::Structure isa PPI::Node isa PPI::Element DESCRIPTION
"PPI::Structure::Unknown" is class for braces whose type is unknown, or temporarily unknown. It primarily exists temporarily inside the lexer. Although some types of braces can be determined immediately at opening, there are a number of different brace types that can only be correctly identified after the braces are closed. A structure is typed as unknown during this period it is indeterminate. A "PPI::Structure::Unknown" object should not ever make it out of the lexer without being converted to it's final type. Any time you encounter this class in a PDOM tree it should be considered a bug and reported accordingly. METHODS
"PPI::Structure::Unknown" has no methods beyond those provided by the standard PPI::Structure, PPI::Node and PPI::Element methods. Got any ideas for methods? Submit a report to rt.cpan.org! SUPPORT
See the support section in the main module. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.18.2 2011-02-25 PPI::Structure::Unknown(3)
All times are GMT -4. The time now is 04:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy