Hello, I have a file, and one column has both positive and negative numbers. Does anyone know how I can calculate the total of all the values (i.e, +ve and -ve).
eg:
col1 col2 col3
data 23 data
data 76 data
data -30 data
Thanks
Khoom (1 Reply)
i know how to add two numbers using expr,
but if i have a file with hundreds of numbers, how do i add them all together, without typing them all one by one?
for example, file.txt contains
4
5
6
7
how can i give a command to add them, without typing
$ expr `4 + 5 + 6 + 7` (7 Replies)
Hi this is quite a simple question... I am new to LINUX/UNIX and so I am just trying to create a very basic program. The idea is that when the user runs the program (from the shell) they enter 3 values and the program will add them up:
"./sum 23 5 1
29"
my code for this program is as follows:
... (4 Replies)
Hi
I figured how to add my list of numbers. However how do I count so that after a certain number it lists the line.
Example:
12 test1
46 test2
195 test3
174 test4
634 test5
185 test6
94 test7
So basically add the numbers and when the addition reaches 300 or less
print the... (8 Replies)
I have a file which has following contents which I want to add up.
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
139038.72
139038.72
139038.72
139038.72 (5 Replies)
Hello. Trying to add a column of numbers and combine the 1st and 2nd fields as uniq with the new total.
This works to add the numbers but can't figure an easy was to combine the 1st and 2nd column as the list is very long. awk '{s+=$3} END {print s}'
bird dog 300
bird dog 100
cat clown 200... (1 Reply)
Hi again. Sorry for all the questions — I've tried to do all this myself but I'm just not good enough yet, and the help I've received so far from bartus11 has been absolutely invaluable. Hopefully this will be the last bit of file manipulation I need to do.
I have a file which is formatted as... (4 Replies)
Hi Folks,
I have a file with 2 columns TAB delimited and I want to add '1' to the first column and subtract '-1' from the second column.
What I have tried so far is;
awk -F"\t" '{ $1-=1;$2+=1}1' OFS='\t' file
File
0623 0623
0624 0624
0643 0643
1059 1037
1037 1037
1038 1038... (2 Replies)
Hi All,
Could you please help me on this requirement.
File data:
A
A
A
B
B
B
i need the output like
A1
A2
A3
B1 (3 Replies)
Discussion started by: bmk123
3 Replies
LEARN ABOUT OSX
svk::command::info
SVK::Command::Info(3) User Contributed Perl Documentation SVK::Command::Info(3)NAME
SVK::Command::Info - Display information about a file or directory
SYNOPSIS
info [PATH | DEPOTPATH]...
OPTIONS -R [--recursive] : descend recursively
DESCRIPTION
For example, here's the way to display the info of a checkout path:
% svk info ~/dev/svk
Checkout Path: /Users/gugod/dev/svk
Depot Path: //svk/local
Revision: 447
Last Changed Rev.: 447
Last Changed Date: 2006-11-28
Copied From: /svk/trunk, Rev. 434
Merged From: /svk/trunk, Rev. 445
You can see the result has some basic information: the actual depot path, and current revision. Next are advanced information about copy
and merge source for this depot path.
The result of "svk info //svk/local" is almost the same as above, except for the "Checkout Path:" line is not there, because you are not
referring to a checkout path.
Note that the revision numbers on "Copied From:" and "Merged From:" lines are for the source path (//svk/trunk), not the target path
(//svk/local). The example above state that, //svk/local is copied from the revision 434 of //svk/trunk, and //svk/local was merged from
the revision 445 of //svk/trunk. Hence if you do a "svk log -r 434 //svk/local", svk would tell you that //svk/local does not exist at
revision 434.
So far there is no easy way to tell the actual revision number of //svk/local right after a copy or merge.
If the target is a depot path, or the corresponding depot path of the target checkout path is actually a mirroring path, the output of this
command will look like this:
% svk info //svk/trunk
Depot Path: //svk/trunk
Revision: 447
Last Changed Rev.: 445
Mirrored From: svn://svn.clkao.org/svk, Rev. 1744
So you can see this depot path is mirrored from a remote repository, and so far mirrored up to revision 1744.
perl v5.10.0 2008-08-04 SVK::Command::Info(3)