How to extract every repeated string between two specific string?
Hello guys,
I have problem with hpux shell script. I have one big text file that contains like
What I need to do is save first SOH*BLA into file1.txt, save second SOH*BLA into file2.txt and so on. Please help me, I don't know how can I do this recursively.
Moderator's Comments:
Please use code tags for sample data and code, too.
Last edited by jim mcnamara; 10-08-2014 at 12:15 AM..
Hi, guys. I have one question:
I need to search for a string in a file, and then extract another string from the file and assign it to a variable.
For example:
the contents of the file (group) is below:
...
ftp:x:23:
mail:x:34
...
testing:x:2001
sales:x:2002
development:x:2003
...... (6 Replies)
Hi all,
I am working on a small prog..
i have a file.txt which contains random data...
K LINES V4 ADD CODE `COMPANY` ADD CODE `DISTRIBUTOR` SEQ NAME^K LINES V5 SEQ NAME^K LINES V6 ADD `PACK-LDATE` SEQ NAME^K^KCOMMAND END^KHEADINFO... (1 Reply)
continuing from my previous post, whose link is given below as a reference
https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569
consider there is create table commands in a file for eg:
CREATE TABLE `Blahblahblah` (
`id` int(11) NOT NULL... (2 Replies)
Hi,
May i ask if someone share some command for extracting a string between 2 ref string in a txt file
My objective: i had a file with multiple lines and wants only to extract the string "watch?v=IbkAXOmEHpY" or "watch?v=<11 random character>", when i used "grep 'watch?=*' i got a results per... (4 Replies)
Hi,
I have a file whose contents are as follows.
2013-03-08/15:09:20.134 INFO 00000000-00000000 0034 09700400 CON_IN SessionID:ED5E1400-4805-85E2-17B2-5BE45684886A Connection
ID:ED5E1400-4805-68F1-BB1D-F06496BCF910 TO:<sip:51234999@10.239.94.146:5060 FROM:<sip:9302280716@97.208.31.7:51024... (2 Replies)
Need Assistance in shell programming... I have a huge file which has multiple stations and i wanted to search particular station and extract few lines from it and the rest is not needed
Bold letters are the stations . The whole file has multiple stations .
Below example i wanted to search... (4 Replies)
Hi Team
I have an huge xml where i need to search for a ceratin numbers. For example
2014-05-06 15:15:41,498 INFO WebContainer : 10 CommonServicesLogs - CleansingTriggerService.invokeCleansingService Entered PUBSUB NOTIFY MESSAGE () -
<?xml version="1.0" encoding="UTF-8"... (5 Replies)
I have a requirement where I have to read the lines between a repeated string
FileName: abc.txt
ls /data/abc.txt
1
2
#ZENCO
3
4
5
6
#ZENCO
11
213
454
7
#ZENCO (8 Replies)
I have this a file.txt with one line, whose content is
/app/jdk/java/bin/java -server -Xms3g -Xmx3g -XX:MaxPermSize=256m -Dweblogic.Name=O2pPod8_mapp_msrv1_1 -Djava.security.policy=/app/Oracle/Middleware/Oracle_Home/wlserver/server/lib/weblogic.policy -Djava.security.egd=file:/dev/./urandom... (3 Replies)
My argument has data as below.
10.9.9.85
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr56scr 127869538
....... (note all these between lines will start with hyphen '-' )
-rwxr-xr-x user1 2019-10-15 17:40... (3 Replies)
Discussion started by: mohtashims
3 Replies
LEARN ABOUT REDHAT
pdl::opt::simplex
Simplex(3) User Contributed Perl Documentation Simplex(3)NAME
PDL::Opt::Simplex -- Simplex optimization routines
SYNOPSIS
use PDL::Opt::Simplex;
($optimum,$ssize) = 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.
$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) = 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 conju-
gate 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 / documenta-
tion under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribu-
tion, the copyright notice should be included in the file.
perl v5.8.0 2000-05-30 Simplex(3)