Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [csv]

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

3
votes
2answers
130 views

MySQL importing CSV files really slow

I am trying to import CSV files into a table, but it has been very slow. I have about 1000 files with a file size of 40 MB each. Whenever I try to import it, I can see with for example MySQL workbench ...
2
votes
1answer
58 views

Libre Office Calc keeps removing quotes

I am opening a .csv file using LibreOffice Calc. However, no matter the format I choose to save the file with after modifying it (either ODF or CSV) for some columns that contained quoted values, the ...
0
votes
1answer
160 views

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.
2
votes
3answers
131 views

Move specific column from csv file in front (select column by name)

Consider this data: #!/usr/bin/env bash cat > example_file.txt <<EOL group, value, price 1, 3.21, 3.21 1, 3.42, 4.11 1, 3.5, 1.22 2, 4.1, 9.2 2, 4.2, 2.11 EOL I want to move the 'value' ...
0
votes
0answers
109 views

csvkit - command line csv viewer and Ubuntu 18.04

Has anyone tried using csvkit in Ubuntu 18.04. I use the command csvlook to view csv files from command line. It used to work in other Ubuntu versions but in 18.04 I get error like the following when ...
0
votes
1answer
116 views

Convert output of shell script to .csv

I want to convert the output of the below patchhistory.sh shell script to csv, so that I can get the information in column format like this: servername patch history ...
2
votes
1answer
178 views

script for csvtool for replacing columns

I want to replace certian columns in a csv file into another and i found this in the csvtoll man page. Which replaces column 1 in the first file with the column 1 in the second file. csvtool ...
1
vote
2answers
68 views

Why Extented Regular expression works on command line input but not when reading from a file

Using Windows 10 developer mode. My regular expression works perfectly when I execute in command prompt. Substitutes mm/dd/yyyy hh:mm to yyyy-mm-dd within a string delimited by comma. It does not ...
0
votes
1answer
208 views

How to combine multiple CSV files to one ods file on the command line. One sheet per original file

How to combine multiple CSV files to one ods file, one sheet per file. I have ten CSV files and I would like to combine them to one ods file comprised of ten sheets, one per original CSV. This should ...
0
votes
0answers
37 views

Drawing contour in gnuplot

How can I draw this contour in gnuplot? I have a data in format.csv.
0
votes
0answers
20 views

.csv Translation Error

I trade cryptocurrencies and when I download an exchange trade history for accounting reasons the .csv file has one line of Chinese characters instead of the trades made. I'm using Ubuntu 18.04 LTS. ...
1
vote
1answer
516 views

To manipulate csv file using bash script or python converting certain rows into column

I have to csv file with 6 column , I want to write script using python or bash so that I can generate a new file may be a txtfile where for each rows first three column remains same that is (column 1, ...
1
vote
2answers
723 views

Delete multiple rows in csv file

I'm working on this assignment to delete rows from a CSV file with different customers. I've figured out how to delete one specific customer by using this code: delete() { awk -F "\"*;\"*" '$1 != '$...
1
vote
1answer
1k views

view the column names for CSV file?

i have a CSV file i want to get the columns name for each column sample : how can i do that with awk or sed or grep ??
2
votes
1answer
1k views

column: line too long error

I'm trying to view the first 5 columns from the terminal following this guide here: https://chrisjean.com/view-csv-data-from-the-command-line/ When I run cat rangelast.csv | sed -e 's/,,/, ,/g' | ...
7
votes
3answers
1k views

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 ...
3
votes
3answers
286 views

Converting numbers in a CSV file to their corresponding URLs

I have a CSV file with two columns (and a header) where each of its elements includes any number between 0 to 199. I want to convert these to their corresponding URLs. Here is an example: 41,51 ...
1
vote
1answer
236 views

How to compare and replace the value at particular location with awk

I want to compare two csv files with one common column and then replace the data from first file to second file at particular location. file1.csv: "id","name","marks","subject","result" "1","a","","...
0
votes
0answers
63 views

How to copy iphone contacts into a csv file

I want to copy my contacts in a csv file and then later on I want to use them with another icloud account by importing the contacts. I am using ubuntu version 17.10,mobile iphone se Can anyone help me ...
1
vote
0answers
84 views

How can I assign a column to represent the x axis values in libre office calc?

Currently my attempt at making a chart looks like this: The goal, nonetheless Is that subdivisions, should be the x axis and not a series of data entries in the chart. I have looked it up but I am ...
3
votes
2answers
174 views

CSV: concatenate more line data

I have this file1.csv: A,dog cat horse cow B,goat deer fish A,deer goat C,dog cat C,goat I need to merge join the similar lines (es. A and C): A,dog cat horse cow deer goat B,goat deer fish C,...
1
vote
1answer
228 views

Commas from csv only partially imported in Libreoffice Calc

I have a CSV here, generated using Rstudio (front-end for R). When I open it with Libreoffice Calc, the preview in the Text import dialog correctly displays the numbers in the last two columns. There ...
0
votes
2answers
48 views

processing lots of images which have their names stored in a csv file from terminal

How can I copy all the images in the second column of a CSV file and put them to a new folder named images? It has about 300k images so I wonder if there is a fast way to this (like I have 12 ...
6
votes
3answers
2k views

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 ...
10
votes
2answers
813 views

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 ...
2
votes
4answers
158 views

How to compare two lines in a file?

Let say I have a file foo.csv: timestamp,id,ip_src,ip_dst,protocol,msg 08/20-12:01:22.172612 ,1000001,10.0.0.2,10.0.0.1,ICMP,"ICMP test detected" 08/20-12:03:22.172809 ,1000001,10.0.0.6,10.0.0.3,...
2
votes
2answers
276 views

Sum column 2 of .csv file if column 1 is the same

I have a csv file where column 1 is the name of a gene and column 2 is a value associated with that gene. However, some genes have multiple values and I want to sum the values of column 2 if column 1 ...
2
votes
2answers
5k views

Bash script to edit excel files

I have multiple excel files in this format. They are clock in and clock out date and time. --------------------------------- | Name | Time | --------------------------------- | ...
1
vote
2answers
2k views

How to convert yaml to csv file format?

I need to write bash script which takes yaml file: first:John last:Smith first:David last:Bennet and convert it to csv file: John,Smith David,Bennet Any ideas? Thanks!
0
votes
3answers
173 views

Can I take text which is in a csv and make it the name of the csv file

I really hope I can explain my issue. Your help will be much appreciated. I have over 1000 csv files which looks exactly the same. Example Malian Aero Company,,,,,Aircraft,TZ-DDG,(Seed 1),,,Block-on ...
-1
votes
1answer
4k views

(Python 3) How to extract data from a column with variable number of values in each row in a CSV file? [closed]

I have a csv file containing data about movies. In the 'Genres' column, the movie which falls under multiple genres has multiple entries which is split using "|". I want to count the number of movies ...
-1
votes
3answers
111 views

grabbing specific columns of a csv

Can you please help to fix this script? $ private=False $ min_num_followers=100 $ max_num_followers=1000 $ awk -v private="$private" '$11=private' ExportData_followers_memoryweaver_37677682_10.csv | ...
1
vote
1answer
94 views

Count number in two columns and generate matrix?

I need to count the number based on two columns in a spreadsheet. Suppose the file looks like this, ordered by name, department, hour: And I need to count the hours of each person according to the ...
0
votes
1answer
421 views

Change default text filter settings in Libreoffice CSV export

I would like to change the default settings that appear in Libreoffice under Ubuntu, when I click save as csv. I would like to use UTF-8, semicolon and "quote all text fields" as default. I don't ...
3
votes
2answers
864 views

Merging 2 csv files

I have two files: a.csv 12,34,56 11,23,67 b.csv 12,34,98 11,23,43 I want to merge them into final.csv: 12,34,56,98 11,23,67,43 and file size is 10gb I have used csvtool but it doesn't work ...
6
votes
4answers
1k views

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 ...
2
votes
2answers
132 views

How I can retrieve emails and websites from csv files in command line?

I have many .csv files (some converted from xlsx), and I am trying to extract emails and websites out of those files. The data in the files looks like: Daniel,Rose,DR@example.com,http://www....
1
vote
1answer
3k views

How can I create a CSV file from a directory listing with multiple columns based on the file names?

I have a list of image files, which are scans of receipts. They look like this: gas_20160710_3432.jpg gas_20160810_242.jpg water_20161004_4510.jpg I would like to be able to take the list of files ...
3
votes
1answer
485 views

Libre Office Calc: Export to CSV with CRLF line endings

I need to be able to save files created in LibreOffice Calc to CSV with the CRLF line endings. I have tried many options but the files always come out missing the CR part. I work with programs that ...
3
votes
2answers
829 views

Using a CSV file to move files to different directories

I have this large directory of 1000+ files from a machine learning dataset, but these files have different qualities (pictures of roses vs. daises to keep it simple). I have this CSV file with the ...
1
vote
1answer
54 views

spread a file into multiple .csv files per each line of inputfile read

I have .csv file with over 1000 rows that contains on each row a number ie, "2224441214" that is the only value on the row. I need to break that file up into a .csv file named "2224441214.csv" for ...
5
votes
1answer
3k views

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 file)? 262145,umbrella,umbrella,carrot,carrot,carrot,carrot,person,person,...
0
votes
2answers
56 views

creating a customized stat file out of files a current directory

I have files like these: $ cat A9E27.txt person,42% person,60% $ cat ffn2eG6.txt train,85% $ cat sBHFgkv.txt person,85% person,73% chair,44% person,57% $ cat A8eVAmK.txt etc etc Some of my txt ...
0
votes
2answers
518 views

add column and save file

How I can add column and overwrite .csv table Command: $ paste -d ' ' 1.csv <(cut -d ' ' -f1 status.csv) $ cat 1.csv 1 2 2 5 $ cat status.csv true false If I use > 1.csv - deleted all ...
1
vote
1answer
261 views

Merging CSVs with cat or other methods

I have CSVs from different directories that have the same filename and I would like to merge them together and place them into a new directory under the same filename, and then loop it through the ...
4
votes
0answers
383 views

Change file icon based on default program

I'm using Ubuntu 16.04 Xenial and this one is alluding me ever since I started using Ubuntu. Question: How do I change file icons based on default program? To phrase it in a different way, how can I ...
4
votes
3answers
277 views

Create csv from inconsistent text file

I have loosely structured records in a file consisting of either 3 or 4 lines of text separated (mostly) by a blank line. Not all records have a blank line separator, but the last line of each starts ...
0
votes
1answer
98 views

CSV data spreadsheet import has unexpected CR\LF

The screenshot shows that an unexpected CR\LF break in the first line of CSV data (see red arrow). I did not expect "Direct" (boxed in red) to show up on line 3 of the spreadsheet. The top of the ...
1
vote
1answer
144 views

libreoffice calc: Importing csv full of URL's

I'm importing a CSV full of date, time, URI, etc., into LibreOffice Calc. I'd like the URIs (which point to documents) to be imported as click-able links, but the Fields > Column-Type drop-down on ...
1
vote
0answers
86 views

Monitor CPU and bandwidth usage of cpu and save to csv

I would like to monitor a specific process. I need to know timestamp, CPU usage (%) and Bandwidth (tcp upload and download in % or byte/s) of this process. I have tried something like this: ps -Ao ...