Sponsored Content
Top Forums Shell Programming and Scripting matching multiple times in same line Post 50657 by oldtrash on Wednesday 28th of April 2004 05:57:55 PM
Old 04-28-2004
Thanks Perderabo,

I did this in Perl using

s/\([abc]+ (\w+)\)/$1/g


Thanks again!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Crons executed multiple times.

For some reason my crons are being executed twice. Any suggestion?? I'm currently on 5.8 (2 Replies)
Discussion started by: shorty
2 Replies

2. Shell Programming and Scripting

Doing one thing multiple times

Hi, I wrote a awk line here: awk 'BEGIN {OFS="\t"} {print $0, int(rand()*($2-$1 + 1) + $1) }' filename Basically what it does is that it takes the start (column 1) and stop (column 2) and generates a random # in between start and stop. I want to take this a step further and have it... (2 Replies)
Discussion started by: phil_heath
2 Replies

3. UNIX for Dummies Questions & Answers

Find string multiple times, same line

Hi everybody, Fairly simple question here: I need an awk, sed, or grep command that will find the same string multiple times on one line needs to return all lines which contain .02 twice. I do know the exact number of characters in between the two occurrences of .02 if that helps, all... (7 Replies)
Discussion started by: jgrosecl
7 Replies

4. Shell Programming and Scripting

Running Multiple Times ?

hey mates, I was wondering if someone could assist me with this one, I have couple scripts that I would like to invoke from .sh ( One after another ) Script1 Script2 Script3 Is it possible to run script 2 after script one finished running ? And again start script 3 after script 2... (6 Replies)
Discussion started by: NDxiak
6 Replies

5. Shell Programming and Scripting

need help using one variable multiple times

I apologize for the title but I am not even sure myself what to call this. I am going to use an example of a pizza delivery. I need to make an interactive script that allows users to order a certain number of pizzas, and then choose what they want on each pizza. Here is my code so far.... ... (1 Reply)
Discussion started by: cstadnyk1
1 Replies

6. Shell Programming and Scripting

How to find multiple line matching?

Hi Unix Gurus, I have two part of question. Any one or both answers will help me a lot. I have a folder with many files in them. They contain SQL statement , Bind variables, Timing etc. I want to find a particular SQL(stored in one file with multiple line). I want to find that SQL in all... (6 Replies)
Discussion started by: ran123
6 Replies

7. Shell Programming and Scripting

Sed replace using same pattern repeating multiple times in a line

Sed replace using same pattern repeating multiple times in a line I have text like below in a file: I am trying to replace the above line to following How can I acheive this? I am able to do it if the occurrence is for 1 time: But If I try like below I am getting like this: I have to... (4 Replies)
Discussion started by: sol_nov
4 Replies

8. Shell Programming and Scripting

Insert lines above matching line with content from matching

Hi, I have text file: Name: xyz Gender: M Address: "120_B_C; ksilskdj; lsudlfw" Zip: 20392 Name: KLM Gender: F Address: "65_D_F; wnmlsi;lsuod;,...." Zip:90233I want to insert 2 new lines before the 'Address: ' line deriving value from this Address line value The Address value in quotes... (1 Reply)
Discussion started by: ysrini
1 Replies

9. Shell Programming and Scripting

Compare file1 for matching line in file2 and print the difference in matching lines

Hello, I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Discussion started by: RasB15
2 Replies

10. Shell Programming and Scripting

Group Multiple Lines on SINGLE line matching pattern

Hi Guys, I am trying to format my csv file. When I spool the file using sqlplus the single row output is wrapped on three lines. Somehow I managed to format that file and finally i am trying to make the multiple line on single line. The below command is working fine but I need to pass the... (3 Replies)
Discussion started by: RJSKR28
3 Replies
Simplex(3pm)						User Contributed Perl Documentation					      Simplex(3pm)

NAME
PDL::Opt::Simplex -- Simplex optimization routines SYNOPSIS
use PDL::Opt::Simplex; ($optimum,$ssize,$optval) = simplex($init,$initsize,$minsize, $maxiter, sub {evaluate_func_at($_[0])}, sub {display_simplex($_[0])} ); DESCRIPTION
This package implements the commonly used simplex optimization algorithm. The basic idea of the algorithm is to move a "simplex" of N+1 points in the N-dimensional search space according to certain rules. The main benefit of the algorithm is that you do not need to calculate the derivatives of your function. $init is a 1D vector holding the initial values of the N fitted parameters, $optimum is a vector holding the final solution. $optval is the evaluation of the final solution. $initsize is the size of $init (more...) $minsize is some sort of convergence criterion (more...) - e.g. $minsize = 1e-6 The sub is assumed to understand more than 1 dimensions and threading. Its signature is 'inp(nparams); [ret]out()'. An example would be sub evaluate_func_at { my($xv) = @_; my $x1 = $xv->slice("(0)"); my $x2 = $xv->slice("(1)"); return $x1**4 + ($x2-5)**4 + $x1*$x2; } Here $xv is a vector holding the current values of the parameters being fitted which are then sliced out explicitly as $x1 and $x2. $ssize gives a very very approximate estimate of how close we might be - it might be miles wrong. It is the euclidean distance between the best and the worst vertices. If it is not very small, the algorithm has not converged. FUNCTIONS
simplex Simplex optimization routine ($optimum,$ssize,$optval) = simplex($init,$initsize,$minsize, $maxiter, sub {evaluate_func_at($_[0])}, sub {display_simplex($_[0])} ); See module "PDL::Opt::Simplex" for more information. CAVEATS
Do not use the simplex method if your function has local minima. It will not work. Use genetic algorithms or simulated annealing or conjugate gradient or momentum gradient descent. They will not really work either but they are not guaranteed not to work ;) (if you have infinite time, simulated annealing is guaranteed to work but only after it has visited every point in your space). SEE ALSO
Ron Shaffer's chemometrics web page and references therein: "http://chem1.nrl.navy.mil/~shaffer/chemoweb.html". Numerical Recipes (bla bla bla XXX ref). The demonstration (Examples/Simplex/tsimp.pl and tsimp2.pl). AUTHOR
Copyright(C) 1997 Tuomas J. Lukka. 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 copyright notice should be included in the file. perl v5.14.2 2012-01-02 Simplex(3pm)
All times are GMT -4. The time now is 12:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy