Sponsored Content
Full Discussion: Increment Numbers in File
Top Forums Shell Programming and Scripting Increment Numbers in File Post 302725225 by pparthiv on Friday 2nd of November 2012 12:38:32 AM
Old 11-02-2012
Thanks bipinajith. Works perfectly. Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read numbers from file and output which numbers belongs to which range

Howdy experts, We have some ranges of number which belongs to particual group as below. GroupNo StartRange EndRange Group0125 935300 935399 Group2006 935400 935476 937430 937459 Group0324 935477 935549 ... (6 Replies)
Discussion started by: thepurple
6 Replies

2. Shell Programming and Scripting

Check file and increment

My scripts excepts 4 files ABCD_01 ABCD_02 ABCD_03 ABCD_04 I want to check for these files , and increment counter one by one . at the end i would like to echo as 4 of 4 expected instances of file found . I tried something like thsi $counter =1 if counter=counter+1 i need... (5 Replies)
Discussion started by: ultimatix
5 Replies

3. Shell Programming and Scripting

File existence and increment

count=0; while read line; do ] && let count=count+1; done < file_name.txt echo echo "$count of 10 files found " echo The scenario is a follows : I have a file which contains a list of filenames present in particular directory . I am checking fo the existence of the file and... (5 Replies)
Discussion started by: ultimatix
5 Replies

4. UNIX for Dummies Questions & Answers

increment numbers in several parts of a string

I know how to do produce this: string01 string02 string03 several different ways. But how do I do produce this (without getting lost in recursion): string01morestring100yetmore10 string02morestring101yetmore20 string03morestring102yetmore30 ...... (2 Replies)
Discussion started by: uiop44
2 Replies

5. Shell Programming and Scripting

Increment a value in a configuration file.

Experts, I would appreciate if someone took the time to express there opinion /approach in creating a new change daily to a configuration file. I create a new log file each day and I wish to have a browser based reader display the new file. To achieve this I would need to create a new... (2 Replies)
Discussion started by: jaysunn
2 Replies

6. Shell Programming and Scripting

the smallest number from 90% of highest numbers from all numbers in file

Hello All, I am having problem to find what is the smallest number from 90% of highest numbers from all numbers in file. I am having file with thousands of lines and hundreds of columns. I am familiar mainly with bash but I am open to whatever suggestion witch will lead to the solutions. If I... (11 Replies)
Discussion started by: Apfik
11 Replies

7. Shell Programming and Scripting

To increment the values from the file

Hi I have the file called "file.txt" which contains the following output $cat file.txt sandy <version>1</version> karen <version>2</version> Rob <version>3</version> peter <version>4</version> i want to write a command which will add the value 1 to the digits and show the output... (2 Replies)
Discussion started by: sidh_arth85
2 Replies

8. Shell Programming and Scripting

Increment value in text file

Hi Guys, I am new to shell programing, I have a csv file which has 50k records and I have got the requirement to increment the value in second column after each 5000 records. for example below A,B,C,D //Header 1,1,London,UK 1,1,Manchester,UK 1,1,Glasgow,UK . . . 1,1,Newyork,USA... (7 Replies)
Discussion started by: rizzu1555
7 Replies

9. Shell Programming and Scripting

[Solved] How to increment and add variable length numbers to a variable in a loop?

Hi All, I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
5 Replies

10. Shell Programming and Scripting

Adding (as in arithmetic) to numbers in columns in file, and writing new file with new numbers

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)
Discussion started by: crunchgargoyle
4 Replies
Math(3pm)						User Contributed Perl Documentation						 Math(3pm)

NAME
PDL::Math - extended mathematical operations and special functions SYNOPSIS
use PDL::Math; use PDL::Graphics::TriD; imag3d [SURF2D,bessj0(rvals(zeroes(50,50))/2)]; DESCRIPTION
This module extends PDL with more advanced mathematical functions than provided by standard Perl. All the functions have one input pdl, and one output, unless otherwise stated. Many of the functions are linked from the system maths library or the Cephes maths library (determined when PDL is compiled); a few are implemented entirely in PDL. FUNCTIONS
acos Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. acos does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. asin Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. asin does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. atan Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. atan does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. cosh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. cosh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. sinh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. sinh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. tan Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. tan does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. tanh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. tanh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. ceil Signature: (a(); [o]b()) Round to integer values in floating-point format. Works inplace. ceil does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. floor Signature: (a(); [o]b()) Round to integer values in floating-point format. Works inplace. floor does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. rint Signature: (a(); [o]b()) Round to integer values in floating-point format. rint uses the 'round half to even' rounding method (also known as banker's rounding). Half-integers are rounded to the nearest even number. This avoids a slight statistical bias inherent in always rounding half-integers up or away from zero. If you are looking to round half-integers up (regardless of sign), try "floor($x+0.5)". If you want to round half-integers away from zero, try "floor(abs($x)+0.5)*($x<=>0)". Works inplace. rint does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. pow Signature: (a(); b(); [o]c()) Synonym for `**'. Works inplace. pow does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. acosh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. acosh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. asinh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. asinh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. atanh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. atanh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. erf Signature: (a(); [o]b()) The error function. Works inplace. erf does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. erfc Signature: (a(); [o]b()) The complement of the error function. Works inplace. erfc does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessj0 Signature: (a(); [o]b()) The regular Bessel function of the first kind, J_n Works inplace. bessj0 does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessj1 Signature: (a(); [o]b()) The regular Bessel function of the first kind, J_n Works inplace. bessj1 does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessy0 Signature: (a(); [o]b()) The regular Bessel function of the second kind, Y_n. Works inplace. bessy0 does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessy1 Signature: (a(); [o]b()) The regular Bessel function of the second kind, Y_n. Works inplace. bessy1 does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessjn Signature: (a(); int n(); [o]b()) The regular Bessel function of the first kind, J_n . This takes a second int argument which gives the order of the function required. Works inplace. bessjn does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessyn Signature: (a(); int n(); [o]b()) The regular Bessel function of the first kind, Y_n . This takes a second int argument which gives the order of the function required. Works inplace. bessyn does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. lgamma Signature: (a(); [o]b(); int[o]s()) log gamma function This returns 2 piddles -- the first set gives the log(gamma) values, while the second set, of integer values, gives the sign of the gamma function. This is useful for determining factorials, amongst other things. lgamma does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. badmask Signature: (a(); b(); [o]c()) Clears all "infs" and "nans" in $a to the corresponding value in $b. badmask can be run with $a inplace: badmask($a->inplace,0); $a->inplace->badmask(0); If bad values are present, these are also cleared. isfinite Signature: (a(); int [o]mask()) Sets $mask true if $a is not a "NaN" or "inf" (either positive or negative). Works inplace. Bad values are treated as "NaN" or "inf". erfi Signature: (a(); [o]b()) The inverse of the error function. Works inplace. erfi does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. ndtri Signature: (a(); [o]b()) The value for which the area under the Gaussian probability density function (integrated from minus infinity) is equal to the argument (cf erfi). Works inplace. ndtri does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. polyroots Signature: (cr(n); ci(n); [o]rr(m); [o]ri(m)) Complex roots of a complex polynomial, given coefficients in order of decreasing powers. ($rr, $ri) = polyroots($cr, $ci); polyroots does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. BUGS
Hasn't been tested on all platforms to ensure Cephes versions are picked up automatically and used correctly. AUTHOR
Copyright (C) R.J.R. Williams 1997 (rjrw@ast.leeds.ac.uk), Karl Glazebrook (kgb@aaoepp.aao.gov.au) and Tuomas J. Lukka (Tuomas.Lukka@helsinki.fi). Portions (C) Craig DeForest 2002 (deforest@boulder.swri.edu). 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 PDL copyright notice should be included in the file. perl v5.14.2 2012-05-30 Math(3pm)
All times are GMT -4. The time now is 08:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy