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

csvstack: Allow file pattern instead of filenames #1107

Open
darwinbandoy opened this issue Feb 4, 2021 · 3 comments
Open

csvstack: Allow file pattern instead of filenames #1107

darwinbandoy opened this issue Feb 4, 2021 · 3 comments

Comments

@darwinbandoy
Copy link

I try to implement csvstack for 160K files csvstack --filenames *.csv > ./merged.csv and I get argument list too long error.

Anyone managed to solve this?

@jpmckinney
Copy link
Member

“Argument list too long” is a shell error, not a csvkit error. The shell expands the * into a list of arguments.

The alternative would be to provide the file pattern to csvkit, and for it to expand it.

I’ll set this as a feature request.

@jpmckinney jpmckinney changed the title csvstack for 160K files csvstack: Allow file pattern instead of filenames Feb 6, 2021
@darwinbandoy
Copy link
Author

I did managed to get around the wildcard (*) argument list too long issue by using ls | grep csv for my customized code. But when I do this for csvstack I only get filenames in a row. This is the code I am using:

ls | grep csv | csvstack --filenames > ./merged.csv

@jpmckinney
Copy link
Member

Yeah, --filenames is to "Use the filename of each input file as its grouping value. When specified, -g will be ignored.". There isn't yet any option for providing filenames via stdin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants