Thank pamu, but the output file is like this:
it would be great if paid can - balance and give out the after calculated result, is there a way to do so?
With the same tested input files above, I hope to get something like this:
I think what rdc did was correct, but I would need exception for when there is no $, or not 2 digits after decimal points.
Last edited by RozenKristal; 12-11-2012 at 02:01 AM..
Reason: Additional info
hi all i am trying to save an awk value into an array in bash:
total=`awk '{sum+=$3} END {print sum}' "$count".txt"`
((count++))
the above statement is in a while loop..
$count is to keep track of file numbers (1.txt,2.txt,3.txt,etc.)
i get the following error:
./lines1:... (1 Reply)
hi i am trying to save the values i extract from a file with the help of awk in a bash shell array.
i have:
exec 10<file2
while read LINE <&10; do
ARRAY1=$(awk '{print $1}' file2)
((count++))
done
echo ${ARRAY1}
it prints just blank lines. file1 has two columns and i... (4 Replies)
hi i am trying to save values in a file in an array in awk..the file is as follows:
0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,
so far i have this:
awk 'BEGIN {RS="\n";FS=","}
{
for(i=1;i<=NR;i++)
{
for(j=1;j<=NF;j++)
{
a=$j;
}
} (4 Replies)
Hi Everyone,
#!/usr/bin/perl
use strict;
use warnings;
my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d");
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
Thanks
find the... (0 Replies)
Hi, im new to shell scripting. i have a query for which i have searched your forums but coulndt get what i need.
i have a file that has two records of exactly the same length and format and they are comma seperated. i need to save the first and the second columns of the input file to 2 different... (11 Replies)
Good day all
I need some helps,
say that I have data like below, each field separated by a tab
DATE NAME ADDRESS
15/7/2012 LX a.b.c
15/7/2012 LX1 a.b.c
16/7/2012 AB a.b.c
16/7/2012 AB2 a.b.c
15/7/2012 LX2 a.b.c... (2 Replies)
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
In the below awk I am splitting $7 on the : and then counting each line or NM_xxxx. If the $1 value is the same for each line then print the $7 that occurs the most with the matching $1 value. The awk seems close but I am not sure what is going on. I included a description as well as to what I... (1 Reply)
I will start with an example of what I'm trying to do and then describe how I am approaching the issue.
File
PS028,005
Lexeme HRS # M #
PhraseType 1(1:1) 7(7)
PhraseLab 501 503
ClauseType ZYq0
PS028,005
Lexeme W # L> # BNH # M #... (17 Replies)
Discussion started by: jvoot
17 Replies
LEARN ABOUT OSF1
balance
balance(8) System Manager's Manual balance(8)NAME
balance - Balances the percentage of used space among volumes in a domain.
SYNOPSIS
/usr/sbin/balance [-v] domain
OPTIONS
Displays information on which files are being moved to different volumes. Selecting this option slows down the balance procedure.
OPERANDS
Specifies the name of the AdvFS file domain.
DESCRIPTION
The balance utility evenly distributes the percentage of used space between volumes in a multivolume domain. This improves performance and
evens the distribution of future file allocations.
Use the showfdmn command to determine the percentage of used space on each volume. This information allows you to determine the need to
balance the volumes.
The balance utility can be used at any time, but it is particularly useful after adding or removing a volume (addvol, rmvol) because these
procedures can cause file distribution to become uneven.
When you plan to run both the defragment and balance utilities on the same domain, run the balance utility before running the defragment
utility. The balance utility often improves the balance of free space, thus enabling the defragment utility to run more quickly.
Before you can balance volumes in a file domain, all filesets in the file domain must be mounted. If you try to balance volumes in an
active file domain that includes unmounted filesets, the system displays an error message indicating that a fileset is unmounted.
RESTRICTIONS
You must be the root user to use this utility.
You cannot run the balance utility while the addvol, rmvol, defragment, rmfset, or balance utility is running on the same file domain. If
you attempt to do this, a warning message is displayed.
The balance utility does not operate on striped files in the domain and does not include them in its calculations on used space.
EXAMPLES
The following example shows the procedure for determining the percentage of used space on each volume of the two-volume usr_domain file
domain and then redistributing the files to balance the percentage of used space. The final showfdmn command shows the redistributed per-
centage of used space. # showfdmn usr_domain
Id Date Created LogPgs Domain Name 2dcab512.000d1ed0 Fri May 7 14:22:26 1999 512 usr_domain
Vol 512-Blks Free % Used Cmode Rblks Wblks Vol Name
1L 819200 126848 85% on 128 128 /dev/dsk8g
2 768281 768080 0% on 128 128 /dev/dsk9d
--------------------------
1587481 894928 44%
# balance usr_domain
balance: Balancing domain 'usr_domain' balance: Balanced domain 'usr_domain'
# showfdmn usr_domain
Id Date Created LogPgs Domain Name 2dcab512.000d1ed0 Fri May 7 14:22:26 1999 512 usr_domain
Vol 512-Blks Free % Used Cmode Rblks Wblks Vol Name
1L 819200 459248 44% on 128 128 /dev/dsk8g
2 768281 433632 44% on 128 128 /dev/dsk9d
--------------------------
1587481 892880 44%
The files are now distributed more evenly between the two volumes.
SEE ALSO
Commands: addvol(8), defragment(8), rmvol(8), showfdmn(8)balance(8)