We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey @dehesa 👋
I am fairly new to this package and I have a question. I want to skip a column during export and import.
Export: Given a CSVEncoder and struct Pet
CSVEncoder
struct Pet
struct Pet { let name: String let age: Int } let pets = ... let encoder = CSVEncoder { $0.headers = ["name", "age"] } let data = try encoder.encode(pets)
Is it possible to skip a particular column, that is, encode only a single column "name" into a csv file?
Import: Given a CSVDecoder,
CSVDecoder
let decoder = CSVDecoder() let result = try decoder.decode([Pet].self, from: data)
Can I import data into an array of Pet, if data does not contain an age column (and perhaps give it a default value if the column does not exist)?
data
Pet
age
Many thanks for your help! 😊 Roman
The text was updated successfully, but these errors were encountered:
dehesa
No branches or pull requests
Question
Hey @dehesa 👋
I am fairly new to this package and I have a question.
I want to skip a column during export and import.
Export: Given a
CSVEncoder
andstruct Pet
Is it possible to skip a particular column, that is, encode only a single column "name" into a csv file?
Import: Given a
CSVDecoder
,Can I import
data
into an array ofPet
, ifdata
does not contain anage
column (and perhaps give it a default value if the column does not exist)?Many thanks for your help! 😊
Roman
System
The text was updated successfully, but these errors were encountered: