Re[Haskell-cafe] ad large file and match lines to a pattern

Hi, I'm a beginner in haskell, I was trying to write the following code, but I still encourage some problems, can you help me with that? I need to read a large file and try to match each line to a pattern which is int,int value="string" for example: 0,1 value="string1" 1,5 value="string2" when the line matches the pattern then I need to get those 3 values (int, int, string) and pass them to my function. -- View this message in context: http://old.nabble.com/Read-large-file-and-match-lines-to-a-pattern-tp2926032... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

On 26 July 2010 00:48, grzyb
Hi,
I'm a beginner in haskell, I was trying to write the following code, but I still encourage some problems, can you help me with that?
I need to read a large file and try to match each line to a pattern which is int,int value="string" for example: 0,1 value="string1" 1,5 value="string2" when the line matches the pattern then I need to get those 3 values (int, int, string) and pass them to my function.
Whilst you can probably use the ReadS (or ReadP if you don't care about backwards compatability) parsers for the Read class to do this, I highly recommend you instead learn and use a proper parsing library such as parsec, polyparse or uuparsing-lib for this (as you'll undoubtedly be wanting to do more extensive parsing at a later date). -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
participants (2)
-
grzyb
-
Ivan Miljenovic