
10 Dec
2019
10 Dec
'19
9:47 a.m.
Hello, I have a bunch of files names like this <prefix>_data_00006.cbf I would like to parse it into this type data CbfDataFile = CbfDataFile Text Int where Test is <prefix> and Int = 6 I am using attoparsec, I started to write my parser like this parseCbfDataFile :: String -> Parser CbfDataFile parseCbfDataFile s = do prefix <- ???? string "_data_" v <- decimal string ".cbf" return (CbfDataFile prefix v) So my question, is how to I write this parser. I miss for now the prefix part, and it seems also to me thaht I need something else for the numeric part. thanks for your help Frederic