Hello.
I face this (2 side) problem.
Some lines with this structure.
...........
12345678 4
12345989 13
12346356 205
12346644 74
12346819 22
.........
The first field (timestamp) is growing (or at least equal).
1)Sum the second fields if the first_field/500 are... (8 Replies)
how to sum particular field in text file
i am having text file like
222|4000|abc
333|5000|xyz
444|6000|mno
i want sum of second field
i.e 4000+5000+6000
can u pls help (3 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Shell script to find sum of first n numbers of Fibonacci series
2. Relevant commands, code, scripts,... (0 Replies)
Hi Everyone,
($total+=$_) for @record;
assume @record=(1,2,3), so the result is 6.
if @record=("1 3","2 3","3 3"), would like to sum up the 2nd field of this array, the result is 9.
i tried " ($total+=$) for @record ", cannot, please advice.
Thanks
---------- Post updated at 03:45... (1 Reply)
Hi Friends,
I have many files like below.
total,0.7%,0.0%,0.2%,0.0%,0.2%,0.7%,98.0%
total,1.9%,0.0%,0.4%,0.0%,0.0%,6.8%,90.6%
total,0.9%,0.0%,0.4%,0.0%,0.0%,0.0%,98.5%
total,1.4%,0.0%,0.7%,0.0%,0.2%,2.9%,94.5%
total,0.7%,0.0%,0.4%,0.0%,0.0%,0.9%,97.7%... (13 Replies)
I want to make a script which takes the number of argument, add those argument and gives output to the user, but I am not getting through...
Script that i am using is below :
#!/bin/bash
sum=0
for i in $@
do
sum=$sum+$1
echo $sum
shift
done
I am executing the script as... (3 Replies)
Hi below is the input file, i need to find repeated words and sum up the values of it which is second field from the repeated work.Im trying but getting no where close to it.Kindly give me a hint on how to go about it
Input
fruits,apple,20,fruits,mango,20,veg,carrot,12,veg,raddish,30... (11 Replies)
Hi All,
I need to calculat the sum of the particular field in text file. And the datatype of the field in file is decimal(18,2). If the file is small, then I am facing any problem. But the file is huge, then the result is converted into exponential format.
I tried using various command thr... (0 Replies)
Hi,
I am new to scripting.I am using redhat linux 6.I am just finding a way to summing up the output displayed as below.It will help me a lot since we used to get this kind of output every now and then.
I am pasting here the output .What is required is this o/p needs to be summed up and... (3 Replies)
Discussion started by: muraliinfy04
3 Replies
LEARN ABOUT DEBIAN
strip_stx
strip_stx(1) General Commands Manual strip_stx(1)NAME
strip_stx - a simple literate programming tool
SYNOPSIS
strip_stx [ -c commentchars ] [ -B open close ] [ file file ... ]
DESCRIPTION
strip_stx takes all structured text (Stx) markup away from the listed files, leaving only text in preformatted blocks. If no files are
listed, standard input is read instead. The result is written to standard output.
This is intended as a simple literate programming tool: programmers may write their programs as documents, processing them with stx2any for
documentation and publication but with strip_stx for compilation / running the code.
More information about Stx is on the manpage of stx2any.
OPTIONS -c commentchars
comment out the non-code portions (text outside preformatted blocks) with the given commentchars at the beginning of every line.
If this option (or the next one) is not given, non-code portions are simply deleted.
-B open close
surround the non-code portions with (comment-)opening and closing markers open and close respectively. This option can be used
together with the -c option.
--version, -V
Just show version information and exit.
--help, -?
Just show a short help message and exit.
EXAMPLES
strip_stx parse.py.stx > parse.py
Strip documentation away from the source file parse.py.stx, supposedly only leaving python code there.
strip_stx -B '/*' ' */' -c ' * ' my.c.stx > my.c
Make a literate C code document into proper C source file, leaving the documentation in neatly-formatted comments.
strip_stx -B 'cat < < EOT' 'EOT' embshell.stx > embshell.sh
Turn the document embshell.stx into an "embedded shell" script, where all non-program portions are printed to the standard output when exe-
cution reaches them. This is akin to PHP or eperl; but strip_stx is not really meant for this. There are other options for making embed-
ded scripts, such as defining your own markup for the code portions or handling the program logic with m4 within stx2any.
SEE ALSO
stx2any (1)
AUTHOR
This page is written by Panu A. Kalliokoski.
Panu A. Kalliokoskistrip_stx(1)