ain :: IO ()
main = do
  argv <- parseArgsIO ArgsComplete argd
  let colspec = case getArg argv ArgCols of
        Nothing -> [0..]
        Just cs -> readSpec "column-spec" cs
  let rowspec = case getArg argv ArgRows of
        Nothing -> [0..]
        Just rs -> readSpec "row-spec" rs
  h <- getArgStdio argv ArgSource ReadMode
  text <- hGetContents h
  let csv = readCSV text
  let rows = select 0 rowspec csv
  let fields = map (select 0 colspec) rows
  hPutCSV stdout fields

main :: IO ()
main = do
  argv <- parseArgsIO ArgsComplete argd
  let colspec = case getArg argv ArgCols of
        Nothing -> [0..]
        Just cs -> readSpec "column-spec" cs
  let rowspec = case getArg argv ArgRows of
        Nothing -> [0..]
        Just rs -> readSpec "row-spec" rs
  h <- getArgStdio argv ArgSource ReadMode
  text <- hGetContents h
  let csv = readCSV text
  let rows = select 0 rowspec csv
  let fields = map (select 0 colspec) rows
  hPutCSV stdout fields
main = do
  argv <- parseArgsIO ArgsComplete argd
  let colspec = case getArg argv ArgCols of
        Nothing -> [0..]
        Just cs -> readSpec "column-spec" cs
  let rowspec = case getArg argv ArgRows of
        Nothing -> [0..]
        Just rs -> readSpec "row-spec" rs
  h <- getArgStdio argv ArgSource ReadMode
  text <- hGetContents h
  let csv = readCSV text
  let rows = select 0 rowspec csv
  let fields = map (select 0 colspec) rows
  hPutCSV stdout fields