Skip to content
New issue

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

row and col change to read #441

Closed
alicera opened this issue Mar 17, 2022 · 3 comments
Closed

row and col change to read #441

alicera opened this issue Mar 17, 2022 · 3 comments

Comments

@alicera
Copy link

alicera commented Mar 17, 2022

/*csv data
name, Joe
birthday, 1970-01-01

I want to change row and col.
Are there code example to process it ?

@jfoclpf
Copy link

jfoclpf commented Mar 21, 2022

What do you mean by chance row and col? Do you mean amend the header title? Do you mean swap columns?

Please be more specific

@alicera
Copy link
Author

alicera commented Mar 21, 2022

change

/*csv data
name, birthday
Joe, 1970-01-01

to

/*csv data
name, Joe
birthday, 1970-01-01

@jfoclpf
Copy link

jfoclpf commented Mar 21, 2022

This lib follows strictly CSV standard RFC4180. What you're requesting is not CSV standard

An optional header line may appear as the first line of the file with the same format as normal record lines. This header will contain names corresponding to the fields in the file and should contain the same number of fields as the records in the rest of the file. CSV commonly employs US-ASCII as character set, but other character sets are permitted.

You want the header to be the first column. You cannot then use any stream reader as you need to fetch the whole file before processing it to get full header, which is very inefficient for big files.

@alicera alicera closed this as completed Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants