Hi RudiC, I am sorry my mistake, I was not clear up, so, look:
I have a directoy with files .CSV with names like this : ESTCOL_GPRS_201611*, these files are a lot, in the * are hour, Minute and seconds. The contents of these files are strings like these:
I wanna to count the unique occurrences for the column 2 and sum all of them and the values sum of column 8 to have an output like this:
Files Records
2,433 , 119,930,636
I have been trying something like this, but yet I have not achieved it
I have not looked even count the number of files (Lineas unique)
Hi there,
I need help.
I want to run the command:
less filename | wc -l
But on multiple files in a directory
So to get those files I would run
ls -ltr | grep filename_2000123 or of course ls -ltr *filename_2000123*
But I am having a problem running a loop to get a count of each... (1 Reply)
I have a command which returns some numbers as follows:
$ls -l ${dbname}.ix* | awk '{print $5 }'
929792
36864
57344
73728
53248
114688
How can I find the sum of those numbers by piping this output into 'awk' or some other editor/command? Thanks a lot -A (3 Replies)
I have 11 directories with around 200 files in each. In each directory the files are labeled out.0 through out.201 . Each file has around 118 numbers in a single column. I need to sum the files in each directory so each directory will have a resultant vector that is 118 numbers long. I then... (5 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Shell script to find sum of first n numbers of Fibonacci series
2. Relevant commands, code, scripts,... (0 Replies)
Hi,
I want to count the number of occurrences of numbers from a file of 6,000,000 lines. Because its too large, I decided to split the counts up in multiple files. So I have files of the counts of 5,000 lines. Now I want to add up the counts of all those files.
The "counts file" looks like... (9 Replies)
Hey everyone,
I've to count lines from string of files names then to show sum output of lines.
for example:
read x = F1 F2 F3
F1 = 12 lines
F2 = 14 lines
F3 = 10 lines
= 36
what I did is:
read x
echo $x >|temp
for x in $(cat temp)
do
wc -l < $x (3 Replies)
Hi all;
Here is my file:
V1.3=4
V1.4=5
V1.1=3
V1.2=6
V1.3=6
Please, can you help me to write a script shell that counts the sum of values in my file (4+5+3+6+6) ?
Thank you so much for help.
Kind regards. (3 Replies)
Discussion started by: chercheur111
3 Replies
LEARN ABOUT MINIX
total
TOTAL(1) General Commands Manual TOTAL(1)NAME
total - sum up columns
SYNOPSIS
total [ -m ][ -sE | -p | -u | -l ][ -i{f|d}[N] ][ -o{f|d} ][ -tC ][ -N [ -r ]] [ file .. ]
DESCRIPTION
Total sums up columns of real numbers from one or more files and prints out the result on its standard output.
By default, total computes the straigt sum of each input column, but multiplication can be specified instead with the -p option. Likewise,
the -u option means find the upper limit (maximum), and -l means find the lower limit (minimum).
Sums of powers can be computed by giving an exponent with the -s option. (Note that there is no space between the -s and the exponent.)
This exponent can be any real number, positive or negative. The absolute value of the input is always taken before the power is computed
in order to avoid complex results. Thus, -s1 will produce a sum of absolute values. The default power (zero) is interpreted as a straight
sum without taking absolute values.
The -m option can be used to compute the mean rather than the total. For sums, the arithmetic mean is computed. For products, the geomet-
ric mean is computed. (A logarithmic sum of absolute values is used to avoid overflow, and zero values are silently ignored.)
If the input data is binary, the -id or -if option may be given for 64-bit double or 32-bit float values, respectively. Either option may
be followed immediately by an optional count, which defaults to 1, indicating the number of double or float binary values to read per
record on the input file. (There can be no space between the option and this count.) Similarly, the -od and -of options specify binary
double or float output, respectively. These options do not need a count, as this will be determined by the number of input channels.
A count can be given as the number of lines to read before computing a result. Normally, total reads each file to its end before producing
its result, but this behavior may be overridden by inserting blank lines in the input. For each blank input line, total produces a result
as if the end-of-file had been reached. If two blank lines immediately follow each other, total closes the file and proceeds to the next
one (after reporting the result). The -N option (where N is a decimal integer) tells total to produce a result and reset the calculation
after every N input lines. In addition, the -r option can be specified to override reinitialization and thus give a running total every N
lines (or every blank line). If the end of file is reached, the current total is printed and the calculation is reset before the next file
(with or without the -r option).
The -tC option can be used to specify the input and output tab character. The default tab character is TAB.
If no files are given, the standard input is read.
EXAMPLE
To compute the RMS value of colon-separated columns in a file:
total -t: -m -s2 input
To produce a running product of values from a file:
total -p -1 -r input
BUGS
If the input files have varying numbers of columns, mean values will certainly be off. Total will ignore missing column entries if the tab
separator is a non-white character, but cannot tell where a missing column should have been if the tab character is white.
AUTHOR
Greg Ward
SEE ALSO cnt(1), neaten(1), rcalc(1), rlam(1), tabfunc(1)RADIANCE 2/3/95 TOTAL(1)