The csv tag has no wiki summary.
13
votes
8answers
2k views
Is there a robust command line tool for processing csv files?
I work with CSV files and sometimes need to quickly check the contents of a row or column from the command line. In many cases cut, head, tail, and friends will do the job; however, cut cannot easily ...
10
votes
4answers
10k views
How to manipulate a CSV file with sed or awk?
How can I do the following to a CSV file using sed or awk?
Delete a column
Duplicate a column
Move a column
I have a big table with over 200 rows, and I'm not that familiar with sed.
7
votes
5answers
2k views
Remove comma between the quotes only in a comma delimited file
I have a input file delimited with commas (,). There are some fields enclosed in double quotes that are having a comma in them. Here is the sample row
123,"ABC, DEV 23",345,534.202,NAME
I need to ...
4
votes
4answers
446 views
A unix command to truncate each line of a file
I have a CSV file and I want to truncate it from the third semicolon. For example, if I have this file:
1;foo;bar;baz;x;y;z
2;foo;bar;baz;x;y;z
3;foo;bar;baz;x;y;z
I want to get the following ...
3
votes
1answer
303 views
How to display TSV (csv) in console, when empty cells are missed by: `column -t -s $'\t' `
I have file with columns spearated with tab.
I have file when some rows have empty cells (on begining, in middle).
In such cases column -t -s $'\t' simply fails:
Input:
$ echo -e ...
2
votes
4answers
644 views
gawk join two TSV by columns (a'la sql join)
How to join, to tsv files, examples:
a.tsv
c 7 r z
d 6 s w
f 1 f f
b 8 p y
a 9 q x
b.tsv
a q a
c r ccc
b p bb
0 0 0
d s dddd
Here I'd like to ...