10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
What to know the way to count the number of delimiters in each record by ignoring the escape delimiters.
Sample Data:
12345678|ABN\|XYZ MED CHEM PTY. LTD.|C||100.00|22|AB"C\|Corp|"XYZ|CDEF"|
I'm using awk -F'|' '{ print NF-1 }' command to find the number of delimiters. this command... (8 Replies)
Discussion started by: BrahmaNaiduA
8 Replies
2. Programming
Hi all,
If i would like to process a file input as below:
col1 col2 col3 ...col100
1 A C E A ...
3 D E G A
5 T T A A
6 D C A G
how can i perform a for loop to count the occurences of letters in each column? (just like uniq -c ) in every column.
on top of that, i would also like... (8 Replies)
Discussion started by: iling14
8 Replies
3. Shell Programming and Scripting
hi, does any one know how to compare a file1 with many files and have to count a number (i.e. 1) like the following ..Thanx in advance
input
file1 file2 file3 filen
1 1 1 1
1 1 1 1
1 1 1 1
0 1 1 1
1 0 0 0
1 0 0 0
0 0 0 0
1 0 1 0
output
instances in file1 only - 2
instances in... (3 Replies)
Discussion started by: quincyjones
3 Replies
4. Shell Programming and Scripting
Hi Guys,
I have 2 files like below
file1
xx
yy
file2
b
yy
b2
xx
c1
yy
xx
yy
Now I want an idea which can count occurences of text from file1 and file2 so outbout would be kind of (9 Replies)
Discussion started by: prashant2507198
9 Replies
5. Shell Programming and Scripting
Hi,
I have a file (movies.sh), this file contains list of movies such as
I want to redirect the movies from movies.sh to file_to_process to allow me process the file with out losing anything.
I have tried
Movies.sh >> file_to_process
But I want to add the row number to the data... (2 Replies)
Discussion started by: INHF
2 Replies
6. Shell Programming and Scripting
I currently use LaTeX together with a sed script to set cloze test papers for my students. I currently pepend and equals sign to the front of the words I want to leave out in the finished test, =perpendicular, for example. I am able to number the blanks using a variable in LaTeX. I would like to... (8 Replies)
Discussion started by: maouinin
8 Replies
7. Shell Programming and Scripting
I have 2 files as follows:
filename1: :
6742 /welcome/mundial98_ahf1_404.htm 1020
6743 /welcome/mundial98_ahf1_404.htm 2224
6744 /welcome/mundial_ef1_404.htm 21678
6745 /welcome/mundial_if_404.htm 4236
6746 /welcome/mundial_lf1_404.htm 21678
filename2:
6746 894694763 1... (2 Replies)
Discussion started by: jontjioe
2 Replies
8. UNIX for Dummies Questions & Answers
hi forums
i need help with a little problem i am having.
i need to count the number of fields that are in a saved variable so i can use that number to make a different function work properly.
is there a way of doing this without using SED/AWK?
anything would be greatly appreciated (4 Replies)
Discussion started by: strasner
4 Replies
9. Shell Programming and Scripting
hi all here is a very simple question.. i want to count the number of columns using awk..my file looks like this:
1,2
1,2
1,2
1,2
1,2
1,2
1,2
1,2
i want to count number of columns and i so far i have:
awk 'BEGIN {IFS=","} END {print NF}' data > data1
i am getting 1... (3 Replies)
Discussion started by: npatwardhan
3 Replies
10. Shell Programming and Scripting
Hi,
Suppose i have a inputfile in csv format.
How to use awk to count 'the number of nonempty columns in each row' minus one, and add the value as a new column in the end
For cosmetic reason, it's even better to include a descriptive label for the last column in the first row.
for... (2 Replies)
Discussion started by: grossgermany
2 Replies