[Haskell-cafe] How to put data from a string to a tuple
Pradeep Wickramanayake
pradeep at talk.lk
Fri Mar 5 10:52:50 EST 2010
As luke requested
Here is the codes and some more brief explanation. Please help me
getItemFile :: IO String
getItemFile =
do
test <- readFile
"input.txt"
return test
im taking a file data to a string
it contains string like "hello,world,I,am,a,new,developer"
so I need to put these each to a tuple. Because the content have Integers
and Strings
sortList2 :: String -> String
sortList2 (x:xs)
| x == ',' = ""
| otherwise = [x] ++ sortList2 xs
Im breaking word by word from this above function
Now I need to send it to a tuple. Can someone help me how to do it. Is this
possible. Using recursion im checking each word till "," occurs
And taking that string and passing it to the tuple.
Can someone please help me to do it.
Please
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100305/ba83e75f/attachment.html
More information about the Haskell-Cafe
mailing list