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
0
votes
1 answer

what are encoding options for csvcut?

I'm getting errors using csvcut stating that the input is not UTF-8 encoded. according to the documentation https://csvkit.readthedocs.io/en/latest/scripts/csvcut.html there's a command line option [-e ENCODING] that doesn't appear to have any…
0
votes
0 answers

using bash to write azure resource tagging script

I am in the initial stage but some help would really be appreciated. I am writing this to get the my subscription and resource group details from the az-tag reports. I am using that csv file to provide the input to my script. Below is my script. #!…
0
votes
0 answers

Building useable program in Terminal/Applescript for extracting XLSX to CSV

I'm looking for a way to automate XLSX to CSV conversion. Ideally, I would also like to add column names that are not yet in the XLSX. For now, I'm using CSVkit/In2CSV. This works, but I still have to enter the name of the file manually. In…
0
votes
1 answer

csvgrep from csvkit search multiple strings

Looking at the docs for csvgrep https://csvkit.readthedocs.io/en/1.0.2/scripts/csvgrep.html I don't inherently see a way to search for multiple strings? Am I missing something? csvgrep -c 1 -m "test" -m " test2" file.csv | csvlook | less -s
Tony
  • 8,681
  • 7
  • 36
  • 55
0
votes
0 answers

find out what happened to mysql table

recently I received a task to insert all data in a xls table into a mysql table. so I changed the excel sheet headers to match what was in the mysql table and used csvkit - csvsql to insert the data into the table. now, the excel sheet had a few…
John11
  • 437
  • 1
  • 6
  • 16
0
votes
1 answer

Why in2csv not converting my XLSX file with non-ascii sheet title? [CentOS x64]

My problem is that I have an Excel XLSX file with non-ascii sheet name (Общий отчет) and I'm trying to convert it to CSV using in2csv tool. I run it from PHP using exec function. On my local machine (Windows 10 x64) it's workong OK. I'm trying to…
StackTracer
  • 45
  • 2
  • 7
0
votes
2 answers

how can I edit the output of csvstat to... csv

How can I edit the output of csvkit's csvstat tool so it is formatted as... CSV? More specifically, csvstat can output counts & tabulations from the contents of CSV files. For example, the following command will read a file named data.csv and then…
ericleasemorgan
  • 213
  • 1
  • 11
0
votes
1 answer

How to fetch a column from csv A with a column as a key from csv B

I am trying to correct my districtname column in A.csv by comapring it to National CSV database B.csv Here are the contents of my A.csv "Series","No","districtname","PinCode" "A","101","Mysuru","570010" "A","103","D. K.…
Ramaprakasha
  • 113
  • 4
0
votes
1 answer

csvsql in csvkit library is missing packages how to fix?

I need to generate a postgresql schema via a csv. I have found the csvkit library with the csvsql functionality. When I run the following command from docs, with my csv: csvsql -i postgresql examples/realdata/FY09_EDU_Recipients_by_State.csv I…
RustyShackleford
  • 3,462
  • 9
  • 40
  • 81
0
votes
1 answer

How to format csv into multiline newline delimited plain text output using csvkit

I have a csv like this, type,name,ad1,pin,ph "A","aaaaa","23 rd.","45789","4578954" "F","bbbbb","23 rd.","84789","4578954" "D","ccccc","34 rd.","45646","7845663" this needs to be formatted to a plain text file like this. type name ad1, PIN-pin PH:…
Ramaprakasha
  • 113
  • 4
0
votes
1 answer

Last Day of Month in csvfile

i try to delete all days of a csv file which not matched last days. But I find not the right solution.…
Silvio
  • 123
  • 1
  • 9
0
votes
0 answers

Sqlite SQL insert, CSV to CSV data wrangling, How should the query be approached?

I'm attempting to insert/wrangle data from one SQLite table to another. Basically my workflow is importing a CSVkit processed CSV into a table named import, creating a new table named export, and then exporting that new table to a fresh CSV. The…
J. M. Becker
  • 2,755
  • 30
  • 32
0
votes
1 answer

CSVKIT: in2csv Batch Convert on Windows 7

I have been CSVKIT on my mac, but I am moving my workflow to a PC platform so others will be able to access my workflow. One of the items I have been using was in2csv for converting Fixed Width file formats. On the mac I have it setup for batch…
John D
  • 139
  • 13
0
votes
1 answer

Change the output directory on command line For Loop

I have been working CSVKIT to build out a solution for parsing fixed-width data files to csv. I have put together the below code to iterate through all the files in a directory, but this same code also places the files back into the same directory…
John D
  • 139
  • 13
0
votes
2 answers

How to insert a column at a certain position in a CSV file using AWK and dealing with quotes?

msg_type,mmsi,timestamp,imo,name,ship_and_cargo_type,length,width,draught,eta_date,destination 24,510041000,2016-07-05 12:49:16 UTC,,,30,29,6,,, 5,371952000,2016-07-16 07:30:40 UTC,9687112,SPRING LEGEND,90,190,32,11.7,2016-08-08 00:00:00…
William Grimes
  • 675
  • 2
  • 11
  • 29