Hi, I've written a shell function in bash that reads letters into an array, then outputs them in one column with:
for n in "${array}"; do
echo $n
done
I was wondering if anyone knew how i would transpose the letters that are output by the for loop. Right now my output is:
aabbcc... (4 Replies)
Hi,
I need to remove all lines from a file that do not start with numbers
For instance, if the first three characters on any line are not numbers, delete those lines
I've tried to do it with awk and it's not working, any ideas ?
Thanks (5 Replies)
I want to add letters A,B,C,… in front of every line of input while printing them out using PERL.
eg
A file is parsed as a cmd line arg and its context will be displayed as
A line1...
B line 2..
I tried this..but I want better and perfect solution!
!perl -p
my $counter;
BEGIN { $counter... (4 Replies)
Hello,
I am working with a perl script that tries to find the average "frequency" in which lines are duplicated. So far I've only managed to find the way to count how many times the lines are repeated, the code is as follows:
perl -ae'
my $filename= $ENV{'i'};
open (FILE, "$filename") or... (10 Replies)
I'm reading in numbers from a file and trying to add them together. Here is the code so far. I know the 1+2+3.... part is wrong. The file has five numbers in it with each number on its own line. The numbers are decimals if that matters. Thanks.
while read EachLine
do
echo $EachLine
done <... (6 Replies)
Hi,
Is there a tool somewhat parallel to rev, but which randomizes instead of reverses?
I've tried rl, but I can only get it to randomize words.
I was hoping for something like this
echo "hello" | ran
leolh
less simpler solutions are also welcome.
Sorry if the question is... (21 Replies)
Hi there,
first of all this is not homework...this is a new type of exercise for practicing vocabulary with my students.
I have a file consisting of two columns, separated by a tab, each line consisting of a word and its definition, separated by a line break.
What i need is to replace a... (15 Replies)
The awk below executes and is close (producing the first 4 columns in desired). However, when I add the sum of $7, I get nothing returned. Basically, I am trying to combine all the matching $4 in f1 and output them with the average of $7 in each match. Thank you :).
f1
... (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT DEBIAN
lire::average
Average(3pm) LogReport's Lire Documentation Average(3pm)NAME
Lire::Average - Lire class that implements the avg operator
SYNOPSIS
use Lire::Average
DESCRIPTION
Class that implements the avg operator. This operator will compute the average value of a DLF field in a group of DLF records.
If the field used by average isn't a numeric fields, the number of different values in that field will be used as the numerator.
It's possible to compute a weighted average by specifying a weighting field.
By default, the average is a by record average. It's possible to compute a by different values average. The list of fields that's used to
determine the different values if speficied in the by-fields attribute.
METHODS
new( %params )
Creates a new Lire::Average object. In addition to the values supported by its parents, the by-fields and weight attributes will be
initialized to the values specified in the %params argument.
by_fields( [$new_by_fields] )
Returns the fields that are going to be used to count the different values which will made up the by part of the average.
This a reference to an array of DLF field names.
If the $new_by_fields parameter is set, it will be used as the new $by_fields value. It must be an array reference and should only contains
valid field names for the current report specification's schema.
weigth( [$new_weight] )
Returns the DLF field's name by which the values will be multiplied before being summed.
You can change the weight field by specifying a new name as the $new_weight parameter. Use undef to remove the use of a weighting field.
SEE ALSO Lire::ReportSpec(3pm), Lire::ReportOperator(3pm),
Lire::Aggregator(3pm), Lire::Aggregate(3pm).
AUTHORS
Francis J. Lacoste <flacoste@logreport.org>
Wolfgang Sourdeau <wsourdea@logreport.org>
VERSION
$Id: Average.pm,v 1.17 2008/03/09 19:27:30 vanbaal Exp $
COPYRIGHT
Copyright (C) 2001-2004 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with
http://www.gnu.org/copyleft/gpl.html.
Lire 2.1.1 2008-03-09 Average(3pm)