import Data.List (unfoldr) split p = unfoldr (\s -> case dropWhile p s of [] -> Nothing ss -> Just $ break p ss) main = interact (\csv -> "
| " ++ concatMap (\c -> case c of {'<' -> "<"; '>' -> ">"; '&' -> "&"; '"' -> """; _ -> [c]}) x ++ " | \n") cols) ++ "