Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C csvkit
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wireservice
  • csvkit
  • Issues
  • #414
Closed
Open
Issue created May 31, 2015 by Administrator@rootContributor

csvstack and one filename

Created by: yn

I like to use csvstack from a shell script like this:

for d in results/*; do
    t=$(basename $d)
    psql -c "drop table $t;"
    csvstack results/$t/* | csvsql --insert --db "postgresql://localhost" --no-inference --no-constraints --tables $t 
done

if there's only one CSV file in a subdirectory of results/ then csvstack errors out. Can CSVstack do something "default" like just echo the input file instead of erroring out? I am happy to submit a PR if you guys think this feature would be accepted.

Assignee
Assign to
Time tracking