Questions tagged [csv]

A comma-separated values file (CSV) stores tabular data in plain-text form.

A comma-separated values (CSV) file stores tabular data (numbers and text) in plain-text form. Plain text means that the file is a sequence of characters, with no data that has to be interpreted instead, as binary numbers. A CSV file consists of any number of records, separated by line breaks of some kind; each record consists of fields, separated by some other character or string, most commonly a literal comma or tab. Usually, all records have an identical sequence of fields.

127 questions
15
votes
1 answer

Is there a way, ideally using the command line, to convert multiple .csv files to one multi-sheet .xls spreadsheet?

Is there a way, ideally using the command line, to convert multiple .csv files to one multi-sheet .xls spreadsheet? If there isn't a cli solution, it'd be good to know if there's an API that works in, ideally, awk or pascal, but, failing that, in…
Peter Brooks
  • 313
  • 2
  • 6
13
votes
5 answers

Add column from one .csv to another .csv file

file1.csv A,,C,D A,,C,D A,,C,D A,,C,D file2.csv A,B A,B A,B A,B desired Output.csv A,B,C,D A,B,C,D A,B,C,D A,B,C,D I've tried using "join" and "paste" to no avail. Is there a bash command to do this? Column "A" is the same in both .csv files.
Roboman1723
  • 2,873
  • 8
  • 23
  • 31
12
votes
1 answer

adding a new column as line number in a csv file

I created a csv file but forgot to add line number as the first column. What is the fastest way to do this (for a large…
Mona Jalal
  • 4,299
  • 20
  • 64
  • 96
12
votes
1 answer

How to batch rename files (images) based on CSV file

What I have and want to achieve: There are thousands of images in one folder. I have a CSV file with following columns: A: original name B: renamed name A typical row looks like this: "original-1.jpg","renamed-1.jpg" …
take2
  • 337
  • 2
  • 3
  • 13
11
votes
2 answers

How can I print sheetnames of a spreadsheet using Linux command-line?

I am aware of using in2csv to save a particular worksheet as a .csv: in2csv --sheet "sheet name" file1.xls > sheet-name.csv But are there any other tools to just print the sheetnames? Perhaps there are options with Perl?
csheth
  • 421
  • 5
  • 16
10
votes
4 answers

Convert .xls/.xlsx spreadsheets to multiple .csv's based on a list

I need to convert all sheets of a single .xls/.xlsx file to a .csv. This will be done on all .xls files in all directories and sub-directories (recursively). Step 1: Get the sheetnames of all .xls into a .csv using: for file in $(find . -name…
csheth
  • 421
  • 5
  • 16
10
votes
1 answer

Convert a .txt file in a .csv with a row every 3 lines

Let's say I have a txt file like this: Mario mario@me.com +399038259953 Luigi luigi@live.com +395902385093 Yoshi yoshi@yahoo.com +81293565291 [and so on for 300 lines...] How do I make a .ods (or .xls, or .csv, it does not matter) file which has…
Dario Costa
  • 121
  • 8
9
votes
5 answers

How can I convert a CSV file to XML?

How can I convert a CSV file to XML? Is there any software for Ubuntu?
Vitor Mazuco
  • 1,361
  • 7
  • 19
  • 34
8
votes
6 answers

Import users from CSV file

Is it possible to import users by using CSV file? or something like a LDAP connection to import all users?
Driekus
  • 113
  • 1
  • 3
7
votes
6 answers

How to transform valid JSON to CSV?

I'm trying to extract information from a JSON file and write some of the contents to a CSV file. Here is an example of my text "data":{"headers":{"sender":"frank@abc.com" "to":"jim@def.com" "subject":"Help with this…
BeMy Friend
  • 1,013
  • 5
  • 14
  • 19
7
votes
3 answers

From XML to CSV with command line

if I have a XML file on local disk, which command is need to convert file in CSV? And from XLSX or XLS to CVS? Thanks.
Noyzware
  • 71
  • 1
  • 1
  • 2
7
votes
3 answers

How to split an ODS spreadsheet file into csv files per sheet on the terminal?

I would like to split a spreadsheet (ods or xlsx) into multiple csv files, one for each sheet in the spreadsheet. I would like to do this without launching a graphical app and preferably in a one liner. Any ideas? Though the linked duplicate…
Bruni
  • 10,180
  • 7
  • 55
  • 97
6
votes
4 answers

How to add users from .csv by specific field?

I'm trying to sort my users into specific servers, so what I'm trying to do at the moment is grab all the users by gender. Essentially I would have one server with all male users and one with all female users. The data in the file per line is read…
Danny
  • 95
  • 1
  • 7
6
votes
4 answers

Comparing two text files

I have 2 big csv files, file1.csv which looks like this 1,2,3,4 1,4,5,6 1,7,8,9 1,11,13,17 file2.csv which looks like this 1,2,3,4 1,7,8,9 2,4,9,10 13,14,17,18 These are just random numbers that I made up, basically the two numbers where…
Lynob
  • 6,615
  • 16
  • 76
  • 108
6
votes
1 answer

Trying to create a CSV file from a text file in Ubuntu

I have a text file that contains passwords and their respective hashes that is formatted as such: 'plaintext password' 'SHA256 hash' 'SHA3-512 hash' This format continues for several more passwords. Each password and hash has its own line within…
1
2 3
8 9