by Insaf
5 replies
Hello
i really need help with perl langage, i have a text file (over 3 million lines) and i want to explore this file and do operations such as "searching"...
But the problem is the time of computing that take my algorithm to have result , the big issue is that i need to read all the file to find what i need ;
Is there any idea how i can reduce th time of computing knowing that i use perl
#perl #programmation
  • Profile picture of the author liamliam
    Why do you want to use perl and why a flat file? Use something like grep instead to search from flat files.
    {{ DiscussionBoard.errors[10219902].message }}
    • Profile picture of the author Insaf
      i cant use grep because i have a file that contains many rules as: A=>B 12 and 12 is a score foreach rules, so i need to extract rules that belongs to a sentence and use the score to extract the max.
      {{ DiscussionBoard.errors[10219958].message }}
  • Profile picture of the author liamliam
    Use getline (IO::Handle - perldoc.perl.org) to go from line to line so you don't have to look through the whole file?
    {{ DiscussionBoard.errors[10220062].message }}
    • Profile picture of the author Insaf
      thanks for your reply i tried IO::Handle but the problem is the same
      {{ DiscussionBoard.errors[10220126].message }}
  • Profile picture of the author David Beroff
    Would it help to rent a powerful server in the cloud for a few hours, and run your searches there, instead?
    Signature
    Put MY voice on YOUR video: AwesomeAmericanAudio.com
    {{ DiscussionBoard.errors[10223453].message }}

Trending Topics