Questions tagged [csv-simple]

Text files containing simple comma separated values. Use this for data that is a subset of real CSV without newlines in (quoted) field content, that can be handled with line oriented tools without the need for a real parser.

Filter by
Sorted by
Tagged with
1
vote
1answer
162 views

How to filter a basic csv by columns

How do I filter by third column of the following file list.txt [[ list of people ]] billy baxter - @baxter - b.baxter@woods.com james woods - @woods - j.woods@someother.com I currently have cat ...
0
votes
1answer
181 views

Merging two Unix files

I have 2 pipe delimited files say file1 and file2. Where file1 has say 33 columns and file2 may have 34/35/36 columns. So let's not consider how many columns we have. What I want to do is compare the ...
2
votes
1answer
1k views

Using fixed strings in regular expressions?

I am writing a bash script which accepts a list of CSV files as arguments and outputs e-mail addresses only found in the first file. To accomplish this, for each record in the first CSV file I look ...
-1
votes
2answers
772 views

How to count the number of parameters in a given line within a CSV file

I've got accumulated data in a CSV file as follows: Parameter_1,Parameter_2,Parameter_3,Parameter_4,Parameter_5,Parameter_6 Parameter_1,Parameter_2,Parameter_3,Parameter_4 Parameter_1,Parameter_2,...
0
votes
1answer
718 views

Data in a CSV file pushed/sent over to Google Charts

I have a CSV file, where the accumulated data is as such (just a snippet): ... 20150327,TEST-MACHINE-091,9,10 20150327,TEST-MACHINE-092,2,7 20150327,TEST-MACHINE-093,1,4 20150328,TEST-MACHINE-091,9,...
1
vote
3answers
758 views

CSV Units Conversion

I've got a CSV file that looks like the following: miami,20,in lansing,2,cm austin,3,mm chicago,5,miles phoenix,2,feet The first field is the name, the next field is the numeric value and the third ...
2
votes
1answer
341 views

Transform .csv into 3 columns and a row

Sample Input: id,Product1,Product2,Product3,Product4 1,0.1,0.3,0.8,0.7 2,0.6,0.7,0.5,0.9 I need output as : id,productname,product_val 1,Product1,0.1 1,Product2,0.3 1,Product3,0.8 1,Product4,0.7 2,...
2
votes
2answers
2k views

CSV > Excel > Graph?

Q: I currently have MQTT client that dumps data in a csv file, is it possible to convert this data into a graph with BASH or Python [automatically]? Can such a thing be done? Or would this be an Excel ...
0
votes
1answer
170 views

Unable to print awk'ed datum in bash script

I am dumping datum into a csv file (my_datum_file.csv). The contents are all comma seperated, and I want to find the last instance of the 4th parameter (i.e. the last instance of datum regarding MX3, ...
1
vote
2answers
2k views

Compare two csv files and append value using awk [closed]

I have two files as follows: file1.csv +------------+----------+--------+---------+ | Account_ID | Asset_ID | LOT_ID | FLAG_F1 | +------------+----------+--------+---------+ | 10000 | 20000 | ...
2
votes
2answers
232 views

Delete rows from a simplified CSV where some columns matching specific pattern

I have the following simplified CSV file (no separators or newlines embedded in fields): ID,PDBID,FirstResidue,FirstChain,SecondResidue,SecondChain,ThirdResidue,ThirdChain,FourthResidue,FourthChain,...
3
votes
4answers
18k views

Compare two .csv files

I have two files: 'file1' has employee ID numbers. 'file2' has the complete database of the employees. Here is what they look like: file1 123123 222333 file2 111222 Jones Sally 111333 Johnson ...
1
vote
3answers
849 views

How can I output sample rows from a .csv?

I'm doing a lot of data merge printing and would like to be able to output, say, 10 samples from a large database. My goal would be to extract the 10 rows spread evenly from the supplied .csv (...
1
vote
3answers
179 views

Filter csv file based on extended column values

I have the following csv file: ID,PDBID,FirstResidue,SecondResidue,ThirdResidue,FourthResidue,Pattern RZ_AUTO_1,4tov,1404,1405,1518,1519,CG/AA Canonical ribose-zipper RZ_AUTO_2,4tov,1405,1406,1517,...
0
votes
2answers
955 views

Downloading images from csv file to a folder based on its id

I have a csv-file that looks like this (short example, there are actually about 20 images per id). 2463666;client@email.fi;yleiskuva;7;kivirealty-original;7;http://d372r717gpt3jp.cloudfront.net/...
0
votes
2answers
986 views

Help to read a flat file into unix and output to simplified csv like format for import into excel

I have a text file that has data written to it in the format below, its thousands of rows. The new record always begins with WHATEVER.RDNDISPLAY or WHATEVER.DSPLY_NAME. The name of the record is ...
0
votes
3answers
1k views

How to concatenate a variable number of csv, removing their header rows?

I have a directory with several hundred csv files whose filenames start with two digits {01..84}. Several hundred >> 84, so obviously some filenames start with the same prefix. I wish to concatenate ...
1
vote
2answers
289 views

Remove a line if regex exists only in 1st column of each line in a csv file

I have the following comma-delimited data (spaces used for visual clarity): 1 2014 23 2352 19.24 7.18 1 2014 23 2353 19.78 4.65 24 2014 23 2354 20.26 25.34 1 2014 23 2355 26.65 42.76 1 2014 23 ...
1
vote
1answer
1k views

Merging CSV (single line per row) files without losing the header line

I need to merge two CSV files: datasorted1.csv and datasorted2.csv, but my headers keep getting sorted. head -n 1 datasorted1.csv datasorted2.csv > resultado.csv && tail -n +2 datasorted1....
1
vote
3answers
4k views

Group by and sum in shell script without awk

I have a file like: $ cat input.csv 201,100 201,300 300,100 300,500 100,400 I want to add the values in column 2 which has same value in column 1. Expected output is as follows: $ cat output.csv ...
1
vote
2answers
665 views

Grep matching cell of the csv file and index of that row

I have csv file and I want to see numbers that start with 0.99 and their row's index which is the first cell of that row. This is what I have so far: cat fil.csv | grep '0\\.99'| tee > (cut -d, ...
1
vote
2answers
1k views

find field pattern in a csv file then count unique field values

I am using Cygwin (bash) to create a script to find, group and count fields in multiple CSV files. Each row will have comma-separated fields with each field following a similar convention. There is a ...
-1
votes
1answer
4k views

search for a character in one column and replace value in another column of matched records

I have a requirement to find value 2 in column 4 and wherever it matches replace 6th column with '-'sign in the beginning suppose if i have csv file - file1 like this abc,0,def,1234,ijk xyz,2,def,...
1
vote
2answers
3k views

Count the maximum character length for all the data fields in a simplified csv file and output to txt

Given a simplified CSV (max one line per row) with many data fields (>50), how can I count the maximum character length for each data field and then export all the counts to a txt file? BTW, I want to ...
3
votes
3answers
7k views

Determine maximum column length for every column in a simplified csv-file (one line per row)

To determine the maximum length of each column in a comma-separated csv-file I hacked together a bash-script. When I ran it on a linux system it produced the correct output, but I need it to run on OS ...
2
votes
2answers
3k views

Delete rows in a simplified csv file (one newline per row) based on a specific column value

I have a csv file with the following headers - Interaction_ID, PDB_ID, First_Residue, First_Chain, Second_Residue, Third_Residue, Third_Chain & Pattern: AM_AUTO_1,1cx0,A166,B,C118,B,G129,B,A-...