 
   defp transform_values([{k, v}|rest], options, acc) do
     atom_k = String.to_existing_atom k
-    case transform_value v, options[atom_k] do
+    case transform_value String.trim(v), options[atom_k] do
       {:error, _} = error -> error
       value -> transform_values rest, options, [{atom_k, value}|acc]
     end

         {"header parse error: #{error}", fname, 0}}
    end
  end

  defp handle_error([missing], fname) do
    {:error, :invalid_header,

    case Integer.parse valstr do
      {value, ""} -> value
      _ -> {:error, "invalid integer"}
    end
  end

  defp transform_value(valstr, :datetime) do
    case Timex.parse(valstr, @date_format) do
      {:ok, dt} ->
        dt |> Timex.to_erl |> Timex.to_datetime(:local)
      {:error, _} = error -> error
    end
  end

