You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Briefly describe the question, bug or feature request.
There are currently options for trimming fields. However, if a file has explicitly quoted fields, this strongly indicates that exactly what is within the quotes should be considered the field value. It would be very useful to have an option to only trim unquoted fields.
Alternatively, a way to get info about if a field was quoted or not when it was parsed would perhaps be even more helpful. This would allow anyone to implement the feature ourselves.
Include a complete program demonstrating a problem.
fnmain(){let text = "Hello, WorldHello,\" This field starts with a space\"";letmut rdr = csv::ReaderBuilder::new().has_headers(false).trim(csv::Trim::All).from_reader(std::io::Cursor::new(&text));for result in rdr.records(){println!("{:?}", result.unwrap().iter().map(|r| r.to_string()).collect::<Vec<_>>());}}
What is the observed behavior of the code above?
["Hello", "World"]
["Hello", "This field starts with a space"]
What is the expected or desired behavior of the code above?
["Hello", "World"]
["Hello", " This field starts with a space"]
The text was updated successfully, but these errors were encountered:
What version of the
csv
crate are you using?1.2.1
Briefly describe the question, bug or feature request.
There are currently options for trimming fields. However, if a file has explicitly quoted fields, this strongly indicates that exactly what is within the quotes should be considered the field value. It would be very useful to have an option to only trim unquoted fields.
Alternatively, a way to get info about if a field was quoted or not when it was parsed would perhaps be even more helpful. This would allow anyone to implement the feature ourselves.
Include a complete program demonstrating a problem.
What is the observed behavior of the code above?
What is the expected or desired behavior of the code above?
The text was updated successfully, but these errors were encountered: