Sponsored Content
Top Forums UNIX for Beginners Questions & Answers sed or awk Replacement/Addition Post 303015740 by RudiC on Wednesday 11th of April 2018 08:45:58 AM
Old 04-11-2018
OK, solved. What if a street has three or more elements as "East New York Ave"?

The sample in post#1 has trailing spaces that don't help either.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Replacement using sed

Hi I have the following file that i need to run a sed command on 1<tab>running 2<tab>running 3<tab>running 4<tab>running I want to be able to replace a line i.e the second one with '2<tab>failed'. As the first number is unique that can be used to search for the relevant line (using ^2 i... (5 Replies)
Discussion started by: handak9
5 Replies

2. UNIX for Dummies Questions & Answers

Awk/Sed One liner for text replacement

Hi group, I want to replace the occurance of a particular text in a paragraph.I tried with Sed,but Sed only displays the result on the screen.How can i update the changes in the original file??? The solution should be a one liner using awk and sed. Thanks in advance. (5 Replies)
Discussion started by: bishnu.bhatta
5 Replies

3. Shell Programming and Scripting

Conditional tab replacement sed/awk

Hi I am struggling to find a solutions to this problem: I have a directory full of files and I wish to: read each line of each file and if any one line in those files is longer than 72 characters I want to replace any tab characters with a space character. Ive been... (3 Replies)
Discussion started by: benackland
3 Replies

4. Shell Programming and Scripting

Help with sed replacement

This seems like it should be an easy problem, but I'm a noob and I can't figure it out. I'm trying to use sed, but would be happy to use anything that does the job. I am trying to trim off a fixed number of unknown characters from 2 different : delimited fields while keeping the intervening... (4 Replies)
Discussion started by: helix_w
4 Replies

5. Shell Programming and Scripting

SED replacement

Hi, i have a file with lines, file.txt ------- test is fun testing is better I need to replace 'test' to 'develop' and i used, a=test b=develop sed "s,$a,$b,g" -------- but i see the word 'testing' is also replaced. Need some solution. Is there any way i could replace only 'test' ? (4 Replies)
Discussion started by: giri_luck
4 Replies

6. Shell Programming and Scripting

Awk addition

How would I print out the total amount through awk? I tried using print "Total Amount: " $4+$4; Would I have to do a for loop to get through everything? (2 Replies)
Discussion started by: Boltftw
2 Replies

7. Shell Programming and Scripting

AWK conditional addition

I have a column of numbers $2, I would like to add 360 to all numbers that are negative. This method seems a bit convoluted, and does not work (outputs 0): BEGIN { A=sprintf("%d", $2); if(A<0) A=A+360; BIN++; } END { for(A in BIN) print... (5 Replies)
Discussion started by: chrisjorg
5 Replies

8. Shell Programming and Scripting

Text replacement with awk or sed?

Hi guys, I worked for almost a half-day for the replacement of some text automatically with script. But no success. The problem is I have hundred of files, which need to be replaced with some new text. It's a painful work to work manually and it's so easy to do it wrong. For example, I... (2 Replies)
Discussion started by: liuzhencc
2 Replies

9. Shell Programming and Scripting

Solution for replacement of 4th column with 3rd column in a file using awk/sed preserving delimters

input "A","B","C,D","E","F" "S","T","U,V","W","X" "AA","BB","CC,DD","EEEE","FFF" required output: "A","B","C,D","C,D","F" "S", T","U,V","U,V","X" "AA","BB","CC,DD","CC,DD","FFF" tried using awk but double quotes not preserving for every field. any help to solve this is much... (5 Replies)
Discussion started by: khblts
5 Replies

10. Shell Programming and Scripting

Multiple Replacement in a Text File in one operation (sed/awk) ?

Hi all, Saying we have two files: 1. A "Reference File" whose content is "Variable Name": "Variable Value" 2. A "Model File" whose content is a model program in which I want to substitute "VariableName" with their respective value to produce a third file "Program File" which would be a... (4 Replies)
Discussion started by: dae
4 Replies
SLAGTS(l)								 )								 SLAGTS(l)

NAME
SLAGTS - may be used to solve one of the systems of equations (T - lambda*I)*x = y or (T - lambda*I)'*x = y, SYNOPSIS
SUBROUTINE SLAGTS( JOB, N, A, B, C, D, IN, Y, TOL, INFO ) INTEGER INFO, JOB, N REAL TOL INTEGER IN( * ) REAL A( * ), B( * ), C( * ), D( * ), Y( * ) PURPOSE
SLAGTS may be used to solve one of the systems of equations (T - lambda*I)*x = y or (T - lambda*I)'*x = y, where T is an n by n tridiagonal matrix, for x, following the factorization of (T - lambda*I) as (T - lambda*I) = P*L*U , by routine SLAGTF. The choice of equation to be solved is controlled by the argument JOB, and in each case there is an option to perturb zero or very small diagonal elements of U, this option being intended for use in applications such as inverse iteration. ARGUMENTS
JOB (input) INTEGER Specifies the job to be performed by SLAGTS as follows: = 1: The equations (T - lambda*I)x = y are to be solved, but diagonal elements of U are not to be perturbed. = -1: The equa- tions (T - lambda*I)x = y are to be solved and, if overflow would otherwise occur, the diagonal elements of U are to be per- turbed. See argument TOL below. = 2: The equations (T - lambda*I)'x = y are to be solved, but diagonal elements of U are not to be perturbed. = -2: The equations (T - lambda*I)'x = y are to be solved and, if overflow would otherwise occur, the diagonal elements of U are to be perturbed. See argument TOL below. N (input) INTEGER The order of the matrix T. A (input) REAL array, dimension (N) On entry, A must contain the diagonal elements of U as returned from SLAGTF. B (input) REAL array, dimension (N-1) On entry, B must contain the first super-diagonal elements of U as returned from SLAGTF. C (input) REAL array, dimension (N-1) On entry, C must contain the sub-diagonal elements of L as returned from SLAGTF. D (input) REAL array, dimension (N-2) On entry, D must contain the second super-diagonal elements of U as returned from SLAGTF. IN (input) INTEGER array, dimension (N) On entry, IN must contain details of the matrix P as returned from SLAGTF. Y (input/output) REAL array, dimension (N) On entry, the right hand side vector y. On exit, Y is overwritten by the solution vector x. TOL (input/output) REAL On entry, with JOB .lt. 0, TOL should be the minimum perturbation to be made to very small diagonal elements of U. TOL should normally be chosen as about eps*norm(U), where eps is the relative machine precision, but if TOL is supplied as non-positive, then it is reset to eps*max( abs( u(i,j) ) ). If JOB .gt. 0 then TOL is not referenced. On exit, TOL is changed as described above, only if TOL is non-positive on entry. Otherwise TOL is unchanged. INFO (output) INTEGER = 0 : successful exit element of the solution vector x. This can only occur when JOB is supplied as positive and either means that a diagonal element of U is very small, or that the elements of the right-hand side vector y are very large. LAPACK version 3.0 15 June 2000 SLAGTS(l)
All times are GMT -4. The time now is 12:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy