Count columns that are non-empty per line


 
Thread Tools Search this Thread
Top Forums Programming Count columns that are non-empty per line
# 8  
Old 09-19-2018
Thank you!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count the pipes "|" in line and delete line if count greter then number.

Hello, I have been working on Awk/sed one liner which counts the number of occurrences of '|' in pipe separated lines of file and delete the line from files if count exceeds "17". i.e need to get records having exact 17 pipe separated fields(no more or less) currently i have below : awk... (1 Reply)
Discussion started by: ketanraut
1 Replies

2. Shell Programming and Scripting

Need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line...

Hello, I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be: SRVXPAPI001 ERRO JUN24 07:28:34 1775 REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F ... (8 Replies)
Discussion started by: Ferocci
8 Replies

3. UNIX for Dummies Questions & Answers

Filling in the empty columns with rows above them

Hi, I have a text file where some of the values in columns are missing: Input: QhFudW3dKSYL2NTQUA 1 11133999-11134048 uhIp9KxB6USIy16CEY 1 11126760-11126774 11126775-11126805 11128065-11128068 6epeZ6CTNW4Au8uXys 1 24480823-24480872 Tp3nvutucBZ13CjuXc 1 155204870-155204891... (3 Replies)
Discussion started by: evelibertine
3 Replies

4. UNIX for Dummies Questions & Answers

Filling in the empty columns with the rows above them

I have a text file that looks like the following: 5.644 39.2% 0.00 0.50 rs1695626 4 -0.003 0.21% 0.03 0.73 rs1763326 3 -0.001 0.03% 0.00 0.89 5.645 39.2% 0.00 0.50 rs770721 2 -0.002 0.07% 0.01 0.84... (7 Replies)
Discussion started by: evelibertine
7 Replies

5. UNIX for Dummies Questions & Answers

Filling in the empty columns using the rows above them

I have a text file that looks like the following: rs529715 CFD rs1550758 CIDEB Magmas rs12542019 CPNE1 RBM12 rs10515181 CPNE1 RBM12 rs4411112 CPT1A Some rows have 1 column, whereas some have 2. The ones that have 2 columns have one column (1st column) that start with rs. I need to... (6 Replies)
Discussion started by: evelibertine
6 Replies

6. UNIX for Dummies Questions & Answers

Deleting all rows with empty columns

I have a text file that looks like this: 1 rs523634 8.22486 1 1 rs585160 8.22488 1 rs497228 8.2249 1 1 rs600933 8.225 1 rs480106 8.22531 1 rs600199 8.22533 1 rs529015 8.22534 1 rs598894 8.22534 I want to delete the rows with empty... (2 Replies)
Discussion started by: evelibertine
2 Replies

7. Shell Programming and Scripting

Fill the empty line by adding line before blank line

FIle A "A" 2 aa 34 3 ac 5 cd "B" 3 hu 67 4 fg 5 gy output shud be A"" 2 aa 34 "A" 3 ac 34 "A" 5 cd 34 "B" 3 hu 67 "B" 4 fg 67 "B" 5 gy 67 (6 Replies)
Discussion started by: cdfd123
6 Replies

8. Shell Programming and Scripting

count words and empty files

Hello, I will count words in a file (or more files) and count (if given up) empty files (test -z?), how can I do this? Like this: There are "108" words in "3" files There are "2" empty files Thanks for your reaction. Regards, Arjan Engbers (My English is not good, I hope you... (4 Replies)
Discussion started by: arjanengbers
4 Replies

9. UNIX for Dummies Questions & Answers

Merging Non-Empty Columns within a CSV

I am trying to place all my data in a single row (order doesn't matter). Note I am a Unix novice, so please go easy on me. Here is an example Raw data: row# (1) 45 64 23 (2) 32 1 6 56 (3) 32 45 Needs to be like this: row# (1) 45 (2) 32 (3) 32 ... (2 Replies)
Discussion started by: mmann1123
2 Replies

10. UNIX for Dummies Questions & Answers

Count of Field for Non-Empty

Hi Guys, I wanted to count the number of records for a particular field of a file. whose fields are separated by comma"," I fI use this command. cat "filename" cut -sd "," -f13 | wc -l This shows all the lines count including the blank values for the field number 13. I wanted to count... (2 Replies)
Discussion started by: Swapna173
2 Replies
Login or Register to Ask a Question
COLUMN(1)						    BSD General Commands Manual 						 COLUMN(1)

NAME
column -- columnate lists SYNOPSIS
column [-tx] [-c columns] [-s sep] [file ...] DESCRIPTION
The column utility formats its input into multiple columns. Rows are filled before columns. Input is taken from file operands, or, by default, from the standard input. Empty lines are ignored. The options are as follows: -c Output is formatted for a display columns wide. -s Specify a set of characters to be used to delimit columns for the -t option. -t Determine the number of columns the input contains and create a table. Columns are delimited with whitespace, by default, or with the characters supplied using the -s option. Useful for pretty-printing displays. -x Fill columns before filling rows. column exits 0 on success, >0 if an error occurred. ENVIRONMENT
COLUMNS The environment variable COLUMNS is used to determine the size of the screen if no other information is available. EXAMPLES
(echo "PERM LINKS OWNER GROUP SIZE MONTH DAY HH:MM/YEAR NAME"; ls -l | sed 1d) | column -t SEE ALSO
colrm(1), ls(1), paste(1), sort(1) HISTORY
The column command appeared in 4.3BSD-Reno. BSD
March 9, 2008 BSD