I have a small perl script with a hash (frequency list of words of some text file which I can specify) and a array (list of English words). The script checks how many words of the input text file matches words in the array and then scores a percentage depending on how many words matched out of the total.
I have a folder with about a hundred text files that I want to run the same script on. I want to code my perl script to ask the user to type in the folder name, and then the script should run through all of the text files within. How can I do this?
Also, once the script has run through all of the text files I want to output them into different folders depending on the percentage they scored. For example if a text file matches 75 percent, I want the perl script to place it into a folder named '75'. How can I do this?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||