> -----Urspr�ngliche Nachricht-----
> Von: steve silvers [mailto:[EMAIL PROTECTED] 
> Gesendet: Mittwoch, 10. November 2004 17:02
> An: [EMAIL PROTECTED]
> Betreff: Probably need help with a hash to do this
> 
> 
> I have no idea how to do this. I have tens of thousands of 
> lines in a text 
> file that houses numbers for internal purposes. There are 
> usually 20 on a 
> line, with a range of (01 - 80).
> 
> Example:
> 
> my @data = (
> '08|10|13|16|19|22|28|32|33|37|41|46|47|50|51|52|53|55|71|76',
> '06|11|16|19|20|29|31|35|39|44|50|57|58|59|60|62|71|72|76|77',
> '03|05|06|08|09|10|11|16|17|28|31|41|42|43|45|46|56|61|69|79',
> '05|07|12|13|15|16|17|19|21|25|41|45|47|48|53|58|63|69|76|79',
> '01|02|04|07|08|12|17|19|25|27|29|34|38|44|47|60|62|64|73|75',
> '01|04|06|07|08|09|11|13|14|19|25|26|37|39|41|60|61|62|63|80',
> '04|07|09|17|19|27|28|29|39|41|46|51|52|54|57|58|60|68|74|80'
> );
> 
> foreach (@data) {
>      split(/|/,$_)

---------------------------------
foreach (@data) {map{$a{$_}++}split(/\|/,$_)}
print "$_ is  $a{$_} times found \n" for sort keys %a
----------------------------------

>      # Here is where I need to run "I think a hash" to tell 
> me the two, 
> three, four, five, numbers that appear on each line out of 
> the above 7 
> lines. As an example;
> 
> say I only have two lines in my text file.
> 
> 01|02|03|04|05
> 01|03|05|33|36
> 
> The output needs to say that the above found 01,03,05 in the 
> two sets of 
> numbers.
> Does this make sense? I'm sure this is pretty easy for 
> someone who know 
> hashes real good.
> 
> }
> 
> Any help greatly appreciated
> Steve
> 
> 
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to