Questions tagged [csvkit]

Questions related to use of the cvskit utilities suite, for converting to and working with CSV format files. Check the cvskit Issues list before posting your question, in case there's a known work-around or solution.

The cvskit suite provides script-ready command-line utilities to work with the ubiquitous file format.

Supported platforms

As documented, csvkit supports the following versions of Python. Where appropriate, include these tags in your question, as well as any relevant shell tag:

It is tested on , but has been used successfully by others on both and .

References

54 questions
1
vote
1 answer

Using csvkit to sort on multiple columns, reverse order for some

I am using csvsort from csvkit to sort my csv data. I'd like to sort based on two columns, one of which should be in reverse order. Is that possible? For example: echo 'v1,v2,v3 a,1,z b,3,x c,2,y a,2,y b,1,x …
Matthijs
  • 501
  • 1
  • 3
  • 12
1
vote
1 answer

How to pass string via STDIN into terminal command being executed within python script?

I need to generate postgres schema from a dataframe. I found csvkit library to come closet to matching datatypes. I can run csvkit and generate postgres schema over a csv on my desktop via terminal through this command found in docs: csvsql -i…
RustyShackleford
  • 3,462
  • 9
  • 40
  • 81
1
vote
1 answer

Csvkit how to stack many files

I have about 1.5k csv files and I need to stack them. (OS: win10) How can i stack them using csvkit? (or maybe you can recommend something other that csvkit?) I'm trying to the following. I created the following structure and write cd files for /r…
nbl
  • 11
  • 2
1
vote
1 answer

Use CSVKIT to export list of unique value with counts

I have started using CSVKIT and I have learned a lot about how to use it and ways to manipulate data, but I am still working to gain all the concepts. I was recently asked to produce a record count based on all unique values in a column. I…
John D
  • 139
  • 13
1
vote
1 answer

csvkit in2csv command not working

I followed installment instructions mentioned here Its a simple pip install command After that I went to my linux terminal and wrote in2csvbut got the following error: /usr/bin/in2csv: No such file or directory Originally I tried to install it using…
JavaSa
  • 5,813
  • 16
  • 71
  • 121
1
vote
1 answer

After import csvkit, I have syntax error

I am beginner of python. I imported csvkit, and tried to convert an excel file to CSV file. But I get the syntax error. Could anyone help me with that? Thank you! import csvkit in2csv 2014.xlsx > 2014.csv File "",…
Tan Song
  • 21
  • 3
1
vote
1 answer

CSVSQL - trying to force db-schema without success after getting (in table 'blabla', column 'xyz'): VARCHAR requires a length on dialect mysql

I'm trying to build a table with csvsql. When I use command: csvsql --db mysql://user:password@localhost:3306/database_name --table table_name file.csv I get the error: (in table 'blabla', column 'xyz'): VARCHAR requires a length on dialect…
1
vote
1 answer

Csvkit Library Usage

I'm looking to convert a given excel file to a csv using csvkit as a library, not from the command line. I'm having trouble finding any information on library usage syntax. Can anyone shed some light on how to use csvkit as a library for this…
Marcatectura
  • 1,721
  • 5
  • 30
  • 49
1
vote
2 answers

CSV joining based on keys

This may be a simple/repeat question, but I could find/figure out yet how to do it. I have two csv files: info.csv: "Last Name", First Name, ID, phone, adress, age X [Total age: 100] |009076 abc, xyz, 1234, 982-128-0000, pqt, bcd, uvw, 3124,…
user3285014
  • 319
  • 1
  • 3
  • 12
1
vote
1 answer

How to go though exact number of rows using csvkit

I found csvkit very useful tool, but I can't find anywhere in the doc, how to go through only exact number of rows. I found only command for searching for rows with specific content. csvkit docs http://csvkit.readthedocs.io/en/0.9.1/cli.html#input
Jakub Kohout
  • 1,854
  • 3
  • 21
  • 36
1
vote
1 answer

Python Pandas compare CSV keyerror

I am using Python Pandas to try and match the references from CSV2 to the data in CSV1 and create a new output file. CSV1 reference,name,house 234 8A,john,37 564 68R,bill,3 RT4 VV8,kate,88 76AA,harry ,433 CSV2 reference 234 8A RT4 VV8 CODE import…
fightstarr20
  • 11,682
  • 40
  • 154
  • 278
1
vote
2 answers

Python CSVkit compare CSV files

I have two CSV files that look like this.. CSV 1 reference | name | house ---------------------------- 2348A | john | 37 5648R | bill | 3 RT48 | kate | 88 76A | harry | …
fightstarr20
  • 11,682
  • 40
  • 154
  • 278
0
votes
0 answers

GITBash terminal error while using csvkit (python)

I want to use csvkit from GitBash, windows10, I am following a DataCamp tutorial and this one:https://csvkit.readthedocs.io/en/latest/tutorial/1_getting_started.html#installing-csvkit After installing csvkit using Jupyter QT (Anaconda) I checked…
0
votes
1 answer

I'm getting a module not found error while trying to use convert from the csvkit library

I'm trying to convert files from CSV format to xlsx format by a Batchwise conversion method. I need to convert all the CSV files in a folder to xlsx in one go. The relevant part of the code I used is given here. #import the library from csvkit…
0
votes
3 answers

How do I install csvkit on Mac OS Big Sur?

I'm trying to install csvkit on my Mac (OS 11.7.7). However, I'm getting this 404 error $ brew install csvkit ==> Downloading https://formulae.brew.sh/api/cask.jws.json curl: (22) The requested URL returned error: 404 …
Dave
  • 15,639
  • 133
  • 442
  • 830