Skip to content

Instantly share code, notes, and snippets.

@tfausak
Last active April 2, 2024 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tfausak/ec68921ed4d9a3aadf6f21c1c0f11acc to your computer and use it in GitHub Desktop.
Save tfausak/ec68921ed4d9a3aadf6f21c1c0f11acc to your computer and use it in GitHub Desktop.
Normalize CSV with Haskell.
#!/usr/bin/env stack
-- stack --resolver lts-8.6 --install-ghc script
import Data.ByteString
import Data.Conduit
import Data.Conduit.Binary
import Data.CSV.Conduit
import System.IO
main = transformCSV
defCSVSettings
(sourceHandle stdin)
(awaitForever yield :: Conduit (Row ByteString) IO (Row ByteString))
(sinkHandle stdout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment