in reply to pattern string match while reading from the file

If you're expecting the number as the input, and there is one item per one line in your file, it seems to me you do not need the pattern matching at all. If someone enters 9, just give him 11th line from the file (taking into account two lines with header).
  • Comment on Re: pattern string match while reading from the file