12-11-2008
Average number of each line
Hi,
Please, can anyone help me how to get the average number of each line using awk
Input File:
60 30 23 66 42
32 48 49 27 33
44 22 88 11 21
73 24 38 66 71
Desired Output:
44.2
37.8
37.2
54.4
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me.
I have a file say:
abc
def
ccc
ddd
ffff
The output should be:
Instance1=abc
Instance2=def
Instance3=ccc
Instance4=ddd
Instance5=ffff
... (2 Replies)
Discussion started by: chiru_h
2 Replies
2. Shell Programming and Scripting
Anyone has a script or command in UNIX that can take 4 to five different numbers and calculate the average? (2 Replies)
Discussion started by: bbbngowc
2 Replies
3. Shell Programming and Scripting
Hi,
I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers.
To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
2 Replies
4. Shell Programming and Scripting
Hi Everybody,
I am trying to write a script that will get some perticuler data from a file and redirect to a file.
My Question is,
I have a Very huge file,In that file I have my required data is started from 25th line and it will ends in 100th line.
I know the line numbers, I need to get all... (9 Replies)
Discussion started by: Anji
9 Replies
5. UNIX for Dummies Questions & Answers
Hi All
I like to know how can we calculate the number of rows and the average of the values present in the file. I will not know what will be the rowcount, which will be dynamic in nature of the file.
eg.
29
33
48
30
28 (6 Replies)
Discussion started by: pk_eee
6 Replies
6. Shell Programming and Scripting
Hi friends
I have 100 files in my directory. Each file look like this..
Temp1 Temp2 Temp3
MAS 1 2 3
MAS 4 5 6
MAS 7 8 9
Delhi 10 11 12
Delhi 13 14 15
Delhi 16 17 ... (4 Replies)
Discussion started by: ks_reddy
4 Replies
7. Shell Programming and Scripting
Hi Friends,
In continuation to my earlier post
https://www.unix.com/shell-programming-scripting/99166-script-find-average-given-column-also-specified-number-rows.html
I am extending my problem as follows.
Input:
Column1 Column2
MAS 1
MAS 4 ... (2 Replies)
Discussion started by: ks_reddy
2 Replies
8. Shell Programming and Scripting
Dear users,
I need your support, I have a file like this:
272134.548 6680572.715
272134.545 6680572.711
272134.546 6680572.713
272134.548 6680572.706
272134.545 6680572.721
272134.543 6680572.710
272134.544 6680572.715
272134.543 6680572.705
272134.540 6680572.720
272134.544... (10 Replies)
Discussion started by: Gery
10 Replies
9. UNIX for Dummies Questions & Answers
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
Discussion started by: grc
5 Replies
10. UNIX for Beginners Questions & Answers
Hi Friends ,
I am having one problem as stated file .
Having an input CSV file as shown in the code
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_2_/Q,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0... (4 Replies)
Discussion started by: kshitij
4 Replies
LEARN ABOUT DEBIAN
__gnu_parallel::parallel_tag
__gnu_parallel::parallel_tag(3cxx) __gnu_parallel::parallel_tag(3cxx)
NAME
__gnu_parallel::parallel_tag -
SYNOPSIS
Inherited by __gnu_parallel::balanced_quicksort_tag, __gnu_parallel::balanced_tag, __gnu_parallel::default_parallel_tag,
__gnu_parallel::exact_tag, __gnu_parallel::multiway_mergesort_exact_tag, __gnu_parallel::multiway_mergesort_sampling_tag,
__gnu_parallel::multiway_mergesort_tag, __gnu_parallel::omp_loop_static_tag, __gnu_parallel::omp_loop_tag, __gnu_parallel::quicksort_tag,
__gnu_parallel::sampling_tag, and __gnu_parallel::unbalanced_tag.
Public Member Functions
parallel_tag ()
parallel_tag (_ThreadIndex __num_threads)
_ThreadIndex __get_num_threads ()
void set_num_threads (_ThreadIndex __num_threads)
Detailed Description
Recommends parallel execution at compile time, optionally using a user-specified number of threads.
Definition at line 46 of file tags.h.
Constructor & Destructor Documentation
__gnu_parallel::parallel_tag::parallel_tag () [inline]
Default constructor. Use default number of threads.
Definition at line 53 of file tags.h.
__gnu_parallel::parallel_tag::parallel_tag (_ThreadIndex__num_threads) [inline]
Default constructor. Recommend number of threads to use. Parameters:
__num_threads Desired number of threads.
Definition at line 58 of file tags.h.
Member Function Documentation
_ThreadIndex __gnu_parallel::parallel_tag::__get_num_threads () [inline]
Find out desired number of threads. Returns:
Desired number of threads.
Definition at line 63 of file tags.h.
Referenced by __gnu_parallel::__parallel_sort().
void __gnu_parallel::parallel_tag::set_num_threads (_ThreadIndex__num_threads) [inline]
Set the desired number of threads. Parameters:
__num_threads Desired number of threads.
Definition at line 73 of file tags.h.
Author
Generated automatically by Doxygen for libstdc++ from the source code.
libstdc++ Tue Nov 27 2012 __gnu_parallel::parallel_tag(3cxx)