Trim whitespace in csv headers
See original GitHub issueSometimes the headers include whitespace like
a, b , c, d
1, 2 ,3 , 4
In these cases they shouldn’t be parsed as ' b'
but be ' b'.trim()
instead.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:6
Top Results From Across the Web
How to remove extra spaces in CSV header - Stack Overflow
replace and with are used together to search the string (key), in our case for space (" ") and replace it with empty...
Read more >How to remove trailing whitespaces from column headers in ...
First, let's create some dummy data. You can see that the first column has a trailing whitespace, while the second one has a...
Read more >CSV headers with extra space don't get mapped to correct fields
I think trimming the CSV source columns when entering them in the user interface is a good idea. Trimming the CSV column names...
Read more >CSV Parse - Option trim
The trim option ignore whitespace characters immediately around the delimiter. Defaults to false . It does not remove whitespace present inside the quotes ......
Read more >csv::Trim - Rust - Docs.rs
The whitespace preservation behaviour when reading CSV data. Variants. None. [−] Expand description. Preserves fields and headers. This ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@henningBunk:
data['Issue ID']
doesn’t look very pretty, but solves your problem 😃It would be even better if we could specify transform function for headers. For instance, I have report with following headers: [‘Ship To - Country’, ‘Ship To - State’, ‘Ship To - City’]. But I need: [‘country’, ‘state’, ‘city’]. I can pass a function that will erase 'Ship To - ’ part and lowercase the rest.