On 26 July 2010 00:48, grzyb <[email protected]> wrote: > > 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 [email protected] IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
