05-20-2015
@Corona688:
the average you see is: avg(a[8],b[8],c[8])
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I know this is a stupid question for you guys!
half day googling and i got nothing :(
i have 3 variables/files, say:
$X1 or file1:
# there is one whitespace space after each line
| 21
| 9
| 28
| 100
| 51
$X2 or file2:
# there is one whitespace space... (7 Replies)
Discussion started by: amaulana
7 Replies
2. Shell Programming and Scripting
Hi Everyone,
I need a shell/perl script to bring selected columns from all the files located in a directory and place them in a new file side by side.
File1:
a b c d
2 3 4 5
f g h i
..........
File2:
I II III IV
w x y z
..............
and so on many files are there...... (8 Replies)
Discussion started by: ks_reddy
8 Replies
3. Shell Programming and Scripting
I have 2 text files, both have one simple, single column. The 2 files might be the same length, or might not, and if not, it's unknown which one would be longer.
For this example, file1 is longer:
---file1
Joe
Bob
Mary
Sally
Fred
Elmer
David
---file2
Tomato
House
Car... (3 Replies)
Discussion started by: cajunfries
3 Replies
4. Web Development
I have installed WAMPSERVER 2.0 on my windows vista x64 system but still am having issues with getting the webserver to be seen outside my local network. It is working fine within my local network.
Been through several setup tutorials so far, no dice still.
For testing purposes I have... (1 Reply)
Discussion started by: davidmanvell
1 Replies
5. Shell Programming and Scripting
Input file_1:
P78811
P40108
O17861
Q6NTW1
P40986
Q6PBK1
P38264
Q6PBK1
Q9CZ49
Q1GZI0
Input file_2: (6 Replies)
Discussion started by: patrick87
6 Replies
6. Shell Programming and Scripting
Hi I'm trying to compare 3 or more files based on similar values and outputting them into 3 columns.
For example:
file1
ABC
DEF
GHI
file2
DEF
DER
file3
ABC
DER
The output should come out like this
file1 file2 file3
ABC ABC (4 Replies)
Discussion started by: zerofire123
4 Replies
7. Shell Programming and Scripting
I have about 100s of files of type text in a known directory. I want to merge all files side by side. Number of lines in all the files will remain same.
For example file1 contains
cat
dog
File 2 contains
rat
mat
Output file should be
cat rat
dog mat
Using awk I was able to... (5 Replies)
Discussion started by: kanthrajgowda
5 Replies
8. Shell Programming and Scripting
Hi,
I am looking for a sed/awk script to join two large (~300 M) single column files (one is sorted and the other is not sorted) side-by-side. I have a shell script but its taking ages to do the task so looking for an optimized fast solution.
The two files look like:
File1 (sorted)
a1... (1 Reply)
Discussion started by: sajal.bhatia
1 Replies
9. UNIX for Dummies Questions & Answers
Hi,
Thank you for your help in advance :D.
I have thousands of files like...
file01
file02
file03
.
.
.
file6324
I would like to paste every other file side by side so it looks like
file01 file02
file03 file04
...e.t.c
file6323 file6324 (3 Replies)
Discussion started by: shaz1990
3 Replies
10. Shell Programming and Scripting
Hi everyone,
I need to merge two files side by side
The files look something like this:
HOSTNAME
fishtornado-K52F 127.0.1.1
UPTIME
20:17:01 up 2:19, 3 users,
load average: 0.00, 0.04, 0.05
DISK USAGE
(Size/Used/Avail/Use%)
29G 6.5G 21G 25%
RUN QUEUE
PID COMMAND USER ... (4 Replies)
Discussion started by: FishTornado
4 Replies
LEARN ABOUT SUSE
pdl::reduce
Reduce(3) User Contributed Perl Documentation Reduce(3)
NAME
PDL::Reduce -- a "reduce" function for PDL
DESCRIPTION
Many languages have a "reduce" function used to reduce the rank of an N-D array by one. It works by applying a selected operation along a
specified dimension. This module implements such a function for PDL by providing a simplified interface to the existing projection
functions (e.g. "sumover", "maximum", "average", etc).
SYNOPSIS
use PDL::Reduce;
$a = sequence 5,5;
# reduce by adding all
# elements along 2nd dimension
$b = $a->reduce('add',1);
@ops = $a->canreduce; # return a list of all allowed operations
FUNCTIONS
reduce
reduce dimension of piddle by one by applying an operation along the specified dimension
$a = sequence 5,5;
# reduce by adding all
# elements along 2nd dimension
$b = $a->reduce('add',1);
$b = $a->reduce('plus',1);
$b = $a->reduce('+',1); # three ways to do the same thing
[ As an aside: if you are familiar with threading you will see that this is actually the same as
$b = $a->mv(1,0)->sumover
]
NOTE: You should quote the name of the operation (1st arg) that you want "reduce" to perform. This is important since some of the names are
identical to the names of the actual PDL functions which might be imported into your namespace. And you definitely want a string as
argument, not a function invocation! For example, this will probably fail:
$b = $a->reduce(avg,1); # gives an error from invocation of 'avg'
Rather use
$b = $a->reduce('avg',1);
"reduce" provides a simple and unified interface to the projection functions and makes people coming from other data/array languages
hopefully feel more at home.
$result = $pdl->reduce($operation [,@dims]);
"reduce" applies the named operation along the specified dimension(s) reducing the input piddle dimension by as many dimensions as supplied
as arguments. If the dimension(s) argument is omitted the operation is applied along the first dimension. To get a list of valid operations
see canreduce.
NOTE - new power user feature: you can now supply a code reference as operation to reduce with.
# reduce by summing over dims 0 and 2
$result = $pdl->reduce(&sumover, 0, 2);
It is your responsibility to ensure that this is indeed a PDL projection operation that turns vectors into scalars! You have been warned.
canreduce
return list of valid named "reduce" operations Some common operations can be accessed using a number of names, e.g. '+', "add" and "plus"
all sum the elements along the chosen dimension.
@ops = PDL->canreduce;
This list is useful if you want to make sure which operations can be used with "reduce".
AUTHOR
Copyright (C) 2000 Christian Soeller (c.soeller@auckland.ac.nz). All rights reserved. There is no warranty. You are allowed to redistribute
this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is
separated from the PDL distribution, the copyright notice should be included in the file.
perl v5.12.1 2009-10-17 Reduce(3)