Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by ailse

  1. ailse

    comparing the arrays in a hash of arrays

    ok - never mind - i seem to have cracked it myself, just had to dereference each of the arrays, check the size, and remove it from the hash if it was sized one or smaller :)
  2. ailse

    comparing the arrays in a hash of arrays

    sorry to resurrect this, but need some more advice if anyone can help out - of the two solutions above, I understood rharsh's better so i went with that, however my code now needs to only identify those "colours" that are associated with more than one id. so for my sample input above, i would...
  3. ailse

    comparing the arrays in a hash of arrays

    ok, have given this a go with my data - no joy so far :( this is how i'm populating my hash of arrays: open (FILE, "result.text") while( <FILE> ) { chomp; ## first split ids up from colours my ($id, $colours) = split('\t', $_, 2); ## now split colours into an array my @colour_list =...
  4. ailse

    comparing the arrays in a hash of arrays

    cool, i really needed a fresh perspective on the problem and you have provided just that :) will give this a try and see how it works out, thanks!
  5. ailse

    comparing the arrays in a hash of arrays

    hi all - got a bit of a tricky problem, not even sure if there is a way to do it, but i'll happily be proved wrong!! i have a hash of arrays, generated from a file that looks like this: id val val val id val id val val and so on. i have had no problem reading this file into a hash of...
  6. ailse

    array manipulation question

    thanks steve - but no, that's not quite what i was after, i didn't want the array to "loop round" as it were, so once the final value in the array is reached, the loop should stop. ishnid's suggestion has produced the output i wanted :)
  7. ailse

    array manipulation question

    awesome, thanks :)
  8. ailse

    array manipulation question

    Hi, I am trying to print an array such that each element is followed by the next one, with a tab character in between, and then a new line, so that: @array = ("a", "b", "c", "d"); will be displayed as: a b b c c d so far my code is: my $i; my @array = ("a", "b", "c", "d"); my...
  9. ailse

    using a hash to replace values in a file

    Thanks Steve, I'd never heard of this module before, I'll give it a go :)
  10. ailse

    using a hash to replace values in a file

    Hi, I am trying to use a hash as a lookup to replace 'placeholders' in a file. I have some raw data that I have read into a hash which looks like this: id1 val1 id2 val2 id3 val3 so the keys of the hash are the id's. I have another file which looks like this: enzyme: id1 interacts with...
  11. ailse

    pattern matching between two files

    I have two text files, one of which is a list of names and the other is the "main" file. What I am trying to do is read both files into arrays to that I can identify lines in the "main" file that contain any of the names in my list, and then return those lines from the main file. For example...
  12. ailse

    command line arguments

    thanks for that - tried it with quotes and it's worked how i want it to now :)
  13. ailse

    command line arguments

    Hi there, I am writing a small script to search a text database (data_file.txt) that I have already read into a hash of arrays. My command line should look like: ./search.pl -i data_file.txt -k search terms my problem is that there is usually going to be more than one word following the -k...
  14. ailse

    flat file database

    thanks everyone, for all your useful posts, have got it working great now :)
  15. ailse

    flat file database

    Hi, I have a text database in the following format: id uid short_name desc org where all five are tab-delimited. I am trying to read this into a hash of arrays, so that "id" is the key and an array consisting of fields 1 to 4 is the value for each row in my flat file. What I basically need...

Part and Inventory Search

Back
Top