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
4
votes
5answers
746 views

Count unique associated values in awk (or perl)

I've already found "How to print incremental count of occurrences of unique values in column 1", which is similar to my question, but the answer isn't sufficient for my purposes. First let me just ...
1
vote
3answers
344 views

remove duplicated pattern/entries within each field in CSV file

How do I remove duplicated entries within each separate fields with below sample as data. 0x,9.4,,,#0,#UNIX#unix,#cli#L#فا#0#فا#0#L#SE#Cli#SE,#فارسی#فارسی#۱#1#١#1,bsh,#V & v expected output(...
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 ...
5
votes
1answer
4k views

Print each field of CSV on newline without knowing number of fields

I was playing with IFS today and created a quick text file with a list of numbers separated by commas on 1 line. 1,2,3,4,5 I then tried to write a script to print each number on a newline. I was ...
2
votes
3answers
1k views

Search a directory recursively for files listed in a csv, and copy them to another location

I have a directory (let's call it "Movies") which contains many files and folders. I have a long list of file names in a .csv file (around 4000 entries) which refer to files which are located ...
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 ...
0
votes
2answers
122 views

SED not removing last double quote from every line

I have a CSV that was exported with double quotes around every header and value and I need them gone but without removing double quotes that might actually exist as values. For example: "HEADER1","...
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....
0
votes
0answers
44 views

Want to replace the value of 4th column of data2.csv with the 4th column of other csv file data1.csv where 3rd and 4th column are same in both files

data1.csv 20180318,2121,111,0 20180318,3131,111,0 20180318,4141,111,1 20180318,5141,111,1 20180318,6161,111,0 20180318,8181,111,1 20180318,9191,111,1 20180318,9999,222,1 ...
0
votes
3answers
657 views

Using AWK To Extract Numbers From .CSV File

I have a .CSV file that I need to extract numbers from. Example of file: #File of numbers 1,2,3,4,5 6,7,8,9,10 I want to use awk (or another utility) to extract the first number and second number ...