Sponsored Content
Top Forums Shell Programming and Scripting Delete and retain some characters Post 302815051 by Yoda on Thursday 30th of May 2013 10:53:45 PM
Old 05-30-2013
Code:
sed 's/\.[0-9]* /\./g'

This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. AIX

Delete specific characters

Hi every1 Well i have a list of numbers e.g 12304 13450 01234 00123 14567 what i want is a command to check if the number is starting from 0 and then delete the 0 without doing anything else!!!! any help wud b appreciated!!!!!!!!:( (4 Replies)
Discussion started by: masquerer
4 Replies

2. UNIX for Dummies Questions & Answers

how to delete M-^M characters from a file

I am receiving a file with 'M-^M' characters...how do I get rid of these characters. I tried tr -d '\015' and sed '/^M//g', but they didnot work. Appreciate if someone can help me with this (1 Reply)
Discussion started by: hyennah
1 Replies

3. Shell Programming and Scripting

Delete not readable characters

Hi All, I wanted to delete all the unwanted characters in the string. ie, to delete all the characters which are not alpha numeric values. var1="a./bc" var2='abc/\."123' like to get the output as print var1 abc print var2 abc123 Could you guys help me out pls. Your help is... (3 Replies)
Discussion started by: ajilesh
3 Replies

4. Shell Programming and Scripting

How to delete characters using a file

Hi All, I have a configuration file (file.cfg) in which data will be like this ; , _ + a to z A to Z Now i have to read a textfile (file.txt) and i need to check whether there is any other character present in text file that is not existing in (file.cfg). If other characters are present... (4 Replies)
Discussion started by: krishna_gnv
4 Replies

5. Shell Programming and Scripting

Delete new line characters from a file

Hi, I have a file with about 25 colums separated with '~', but few of the lines have extra tabs ('^') and new line characters ('$'). Is there a way I can delete those characters if they are anywhere before the 25th column in a line? example: CLUB000650;12345678;0087788667;NOOP MEMBER ... (4 Replies)
Discussion started by: rudoraj
4 Replies

6. Shell Programming and Scripting

Delete characters from each line

Hi, I have a file that has data in the following manner, tt_0.00001.dat 123.000 tt_0.00002.dat 124.000 tt_0.00002.dat 125.000 This is consistent for all the entries in the file. I want to delete the 'tt_' and '.dat' from each line. Could anyone please guide me how to do this using awk or... (2 Replies)
Discussion started by: lost.identity
2 Replies

7. Shell Programming and Scripting

need to Delete first 10 characters of a file name

Hello Everyone, I need help in deleting first 10 characters from the filename in a directory eg: 1234567890samplefile1.txt 1234567890samplefile2.txt and so on.. need to get the output as samplefile1.txt Thanks in Advance!!!! (8 Replies)
Discussion started by: Olivia
8 Replies

8. Shell Programming and Scripting

delete first 2 characters for each line, please help

hi, ./R1_970330_210505.sard ./R1_970403_223412.sard ./R1_970626_115235.sard ./R1_970626_214344.sard ./R1_970716_234214.sard ... ... ... for these strings, i wanna remove the ./ for each line how can i do that? i know it could possibly be done by sed, but i really have not idea how... (4 Replies)
Discussion started by: sunnydanniel
4 Replies

9. Shell Programming and Scripting

Delete last characters in each column

I need to delete the last 11 characters from each number and they are all in the same line (each is in a different column): -6.89080901827020800000 3.49348891708562325136 1.47988367839905286876 -2.29707635413510400000 -3.49342364708562325136 -4.43758473239905286876 -2.29707635413510400000... (14 Replies)
Discussion started by: rogeriog.em
14 Replies

10. Shell Programming and Scripting

Delete special characters

My sed is not working on deleting the entire special characters and leaving what is necessary.grep connections_per a|sed -e 's/\<\!\-\-//g' INPUT: <!-- <connections_per_instance>1</connections_per_instance> --> <method>HALF</method> <!--... (10 Replies)
Discussion started by: kenshinhimura
10 Replies
math::special(n)						 Tcl Math Library						  math::special(n)

__________________________________________________________________________________________________________________________________________________

NAME
math::special - Special mathematical functions SYNOPSIS
package require Tcl ?8.3? package require math::special ?0.2? ::math::special::Beta x y ::math::special::Gamma x y ::math::special::erf x ::math::special::erfc x ::math::special::J0 x ::math::special::J1 x ::math::special::Jn n x ::math::special::J1/2 x ::math::special::J-1/2 x ::math::special::I_n x ::math::special::cn u k ::math::special::dn u k ::math::special::sn u k ::math::special::elliptic_K k ::math::special::elliptic_E k ::math::special::exponential_Ei x ::math::special::exponential_En n x ::math::special::exponential_li x ::math::special::exponential_Ci x ::math::special::exponential_Si x ::math::special::exponential_Chi x ::math::special::exponential_Shi x ::math::special::fresnel_C x ::math::special::fresnel_S x ::math::special::sinc x ::math::special::legendre n ::math::special::chebyshev n ::math::special::laguerre alpha n ::math::special::hermite n _________________________________________________________________ DESCRIPTION
This package implements several so-called special functions, like the Gamma function, the Bessel functions and such. Each function is implemented by a procedure that bears its name (well, in close approximation): o J0 for the zeroth-order Bessel function of the first kind o J1 for the first-order Bessel function of the first kind o Jn for the nth-order Bessel function of the first kind o J1/2 for the half-order Bessel function of the first kind o J-1/2 for the minus-half-order Bessel function of the first kind o I_n for the modified Bessel function of the first kind of order n o Gamma for the Gamma function, erf and erfc for the error function and the complementary error function o fresnel_C and fresnel_S for the Fresnel integrals o elliptic_K and elliptic_E (complete elliptic integrals) o exponent_Ei and other functions related to the so-called exponential integrals o legendre, hermite: some of the classical orthogonal polynomials. OVERVIEW
In the following table several characteristics of the functions in this package are summarized: the domain for the argument, the values for the parameters and error bounds. Family | Function | Domain x | Parameter | Error bound -------------+-------------+-------------+-------------+-------------- Bessel | J0, J1, | all of R | n = integer | < 1.0e-8 | Jn | | | (|x|<20, n<20) Bessel | J1/2, J-1/2,| x > 0 | n = integer | exact Bessel | I_n | all of R | n = integer | < 1.0e-6 | | | | Elliptic | cn | 0 <= x <= 1 | -- | < 1.0e-10 functions | dn | 0 <= x <= 1 | -- | < 1.0e-10 | sn | 0 <= x <= 1 | -- | < 1.0e-10 Elliptic | K | 0 <= x < 1 | -- | < 1.0e-6 integrals | E | 0 <= x < 1 | -- | < 1.0e-6 | | | | Error | erf | | -- | functions | erfc | | | | ierfc_n | | | | | | | Exponential | Ei | x != 0 | -- | < 1.0e-10 (relative) integrals | En | x > 0 | -- | as Ei | li | x > 0 | -- | as Ei | Chi | x > 0 | -- | < 1.0e-8 | Shi | x > 0 | -- | < 1.0e-8 | Ci | x > 0 | -- | < 2.0e-4 | Si | x > 0 | -- | < 2.0e-4 | | | | Fresnel | C | all of R | -- | < 2.0e-3 integrals | S | all of R | -- | < 2.0e-3 | | | | general | Beta | (see Gamma) | -- | < 1.0e-9 | Gamma | x != 0,-1, | -- | < 1.0e-9 | | -2, ... | | | sinc | all of R | -- | exact | | | | orthogonal | Legendre | all of R | n = 0,1,... | exact polynomials | Chebyshev | all of R | n = 0,1,... | exact | Laguerre | all of R | n = 0,1,... | exact | | | alpha el. R | | Hermite | all of R | n = 0,1,... | exact Note: Some of the error bounds are estimated, as no "formal" bounds were available with the implemented approximation method, others hold for the auxiliary functions used for estimating the primary functions. The following well-known functions are currently missing from the package: o Bessel functions of the second kind (Y_n, K_n) o Bessel functions of arbitrary order (and hence the Airy functions) o Chebyshev polynomials of the second kind (U_n) o The digamma function (psi) o The incomplete gamma and beta functions PROCEDURES
The package defines the following public procedures: ::math::special::Beta x y Compute the Beta function for arguments "x" and "y" float x First argument for the Beta function float y Second argument for the Beta function ::math::special::Gamma x y Compute the Gamma function for argument "x" float x Argument for the Gamma function ::math::special::erf x Compute the error function for argument "x" float x Argument for the error function ::math::special::erfc x Compute the complementary error function for argument "x" float x Argument for the complementary error function ::math::special::J0 x Compute the zeroth-order Bessel function of the first kind for the argument "x" float x Argument for the Bessel function ::math::special::J1 x Compute the first-order Bessel function of the first kind for the argument "x" float x Argument for the Bessel function ::math::special::Jn n x Compute the nth-order Bessel function of the first kind for the argument "x" integer n Order of the Bessel function float x Argument for the Bessel function ::math::special::J1/2 x Compute the half-order Bessel function of the first kind for the argument "x" float x Argument for the Bessel function ::math::special::J-1/2 x Compute the minus-half-order Bessel function of the first kind for the argument "x" float x Argument for the Bessel function ::math::special::I_n x Compute the modified Bessel function of the first kind of order n for the argument "x" int x Positive integer order of the function float x Argument for the function ::math::special::cn u k Compute the elliptic function cn for the argument "u" and parameter "k". float u Argument for the function float k Parameter ::math::special::dn u k Compute the elliptic function dn for the argument "u" and parameter "k". float u Argument for the function float k Parameter ::math::special::sn u k Compute the elliptic function sn for the argument "u" and parameter "k". float u Argument for the function float k Parameter ::math::special::elliptic_K k Compute the complete elliptic integral of the first kind for the argument "k" float k Argument for the function ::math::special::elliptic_E k Compute the complete elliptic integral of the second kind for the argument "k" float k Argument for the function ::math::special::exponential_Ei x Compute the exponential integral of the second kind for the argument "x" float x Argument for the function (x != 0) ::math::special::exponential_En n x Compute the exponential integral of the first kind for the argument "x" and order n int n Order of the integral (n >= 0) float x Argument for the function (x >= 0) ::math::special::exponential_li x Compute the logarithmic integral for the argument "x" float x Argument for the function (x > 0) ::math::special::exponential_Ci x Compute the cosine integral for the argument "x" float x Argument for the function (x > 0) ::math::special::exponential_Si x Compute the sine integral for the argument "x" float x Argument for the function (x > 0) ::math::special::exponential_Chi x Compute the hyperbolic cosine integral for the argument "x" float x Argument for the function (x > 0) ::math::special::exponential_Shi x Compute the hyperbolic sine integral for the argument "x" float x Argument for the function (x > 0) ::math::special::fresnel_C x Compute the Fresnel cosine integral for real argument x float x Argument for the function ::math::special::fresnel_S x Compute the Fresnel sine integral for real argument x float x Argument for the function ::math::special::sinc x Compute the sinc function for real argument x float x Argument for the function ::math::special::legendre n Return the Legendre polynomial of degree n (see THE ORTHOGONAL POLYNOMIALS) int n Degree of the polynomial ::math::special::chebyshev n Return the Chebyshev polynomial of degree n (of the first kind) int n Degree of the polynomial ::math::special::laguerre alpha n Return the Laguerre polynomial of degree n with parameter alpha float alpha Parameter of the Laguerre polynomial int n Degree of the polynomial ::math::special::hermite n Return the Hermite polynomial of degree n int n Degree of the polynomial THE ORTHOGONAL POLYNOMIALS
For dealing with the classical families of orthogonal polynomials, the package relies on the math::polynomials package. To evaluate the polynomial at some coordinate, use the evalPolyn command: set leg2 [::math::special::legendre 2] puts "Value at x=$x: [::math::polynomials::evalPolyn $leg2 $x]" The return value from the legendre and other commands is actually the definition of the corresponding polynomial as used in that package. REMARKS ON THE IMPLEMENTATION
It should be noted, that the actual implementation of J0 and J1 depends on straightforward Gaussian quadrature formulas. The (absolute) accuracy of the results is of the order 1.0e-4 or better. The main reason to implement them like that was that it was fast to do (the for- mulas are simple) and the computations are fast too. The implementation of J1/2 does not suffer from this: this function can be expressed exactly in terms of elementary functions. The functions J0 and J1 are the ones you will encounter most frequently in practice. The computation of I_n is based on Miller's algorithm for computing the minimal function from recurrence relations. The computation of the Gamma and Beta functions relies on the combinatorics package, whereas that of the error functions relies on the sta- tistics package. The computation of the complete elliptic integrals uses the AGM algorithm. Much information about these functions can be found in: Abramowitz and Stegun: Handbook of Mathematical Functions (Dover, ISBN 486-61272-4) BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category math :: special of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
Bessel functions, error function, math, special functions CATEGORY
Mathematics COPYRIGHT
Copyright (c) 2004 Arjen Markus <arjenmarkus@users.sourceforge.net> math 0.2 math::special(n)
All times are GMT -4. The time now is 02:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy