Questions tagged [columns]
Use this tag when describing a specific portion of a particular group of entries in a table or a matrix or any other structured data set which is vertically aligned.
343 questions
4 votes
3 answers
247 views
Add columns from variable number of files to base file
I'm dealing with a series of bed files, which look like this: chr1 100 110 0.5 chr1 150 175 0.2 chr1 200 300 1.5 With the columns being chromosome, start, end, score. I have multiple different files ...
0 votes
5 answers
1k views
command-line tool to sum the values in a column of a CSV file
I am looking for a command-line tool to calculate the sum of the values in a specified column of a CSV file. (Update: The CSV file might have quoted fields, so a simple solution just to break on a ...
2 votes
1 answer
165 views
What is the purpose of the column with the '0' after the numeric timestamp in .zsh_history?
What is the purpose of the column with 0 after the numeric timestamp in .zsh_history? : 1568128379:0;cp -a ~/.zshrc.pre-oh-my-zsh ~/.zshrc : 1568128381:0;exit Is it part of the timestamp or does it ...
4 votes
3 answers
2k views
Visually aligning columns of a CSV file
Using sed or awk, is it possible to visually align columns in a CSV file? For example: e.g. from: a,b,c,some stuff,"some, other, stuff",d,2023-03-10 18:37:00 y,x,z,t,cool,thing,2022-04-12 21:...
-1 votes
4 answers
119 views
column(1) drops blank leading cells; is it fixable?
Consider this usage of column(1): column -s, -t <<CSV a,b,c ,ee,ff CSV The above snippet emits: a b c ee ff But I was expecting to see something like this: a b c ee ff column ...
0 votes
4 answers
279 views
output a column group by another columns in shell
Thanks in advance! I have a file with 3 columns like this: serv1 red group1 serv1 black group1 serv1 orange group1 serv1 red group2 serv1 orange group2 serv1 red group3 ...
1 vote
2 answers
354 views
Converting column of values from positive to negative
I have an XYZ file, most of the Z values are positive but in fact should be negative. I am wanting to convert all positive values in column three to negative (keeping values already negative the same)....
2 votes
4 answers
696 views
Combine columns into one column (stack)
I have multi-column data that I wish to reformat such that each column follow "on top" of each other in one single column. Example input: 1 2 3 4 1 2 3 4 Desired output: (fixed old ...