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 this:
So I have multiple of those "counts files" which I want to sum.
Does somebody have an idea?
Thanks!
Moderator's Comments:
Please use code tags when posting data and code samples!
Last edited by vgersh99; 08-03-2012 at 01:05 PM..
Reason: code tags, please!
Which numbers, exactly, are you measuring the occurences of? Does their position matter? What should be done with those header lines? What output would you get from the input you posted?
I want to count the number of lines, I need this result be a number, and sum the last numeric column, I had done to make this one at time, but I need to make this for a crontab, so, it has to be an script, here is my lines:
It counts the number of lines:
egrep -i String file_name_201611* |... (5 Replies)
i have multiple files with Batch Header, Record detail & Batch trailer data in the files like :
BH 20150225950050N8262
RD 20140918000000 99999999 unk Deferred Settlement -13950
BT01 -13950
*Above sample data donot have the spaces coorectly defined. I do have multiple batch trailer... (1 Reply)
Hi.. I'm very newbie here..
I wonder if somebody can help me..
I have multiple directories with same out file name for each directories..
./dirA/out.dat
./dirB/out.dat
./dirC/out.dat
..and so on..
for ./dirA/out.dat here is the structure content :
for ./dirB/out.dat the same... (4 Replies)
Hi.. I'm very newbie here..
I wonder if somebody can help me..
I have multiple directories with same out file name for each directories..
./dirA/out.dat
./dirB/out.dat
./dirC/out.dat
..and so on..
for ./dirA/out.dat here is the structure content :
for ./dirB/out.dat the same... (6 Replies)
Hi all,
I have a requirement where i have to read multiple files using Shell Script in Korn Shell.
each file will have the 3rd line as the amount field, i have to read this amount field and sum it for all the files.
any idea on how to achieve this?? (i think i can achieve it using a loop,... (9 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)
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)