Help search and replace the last occurance of match in a file
Hi I want to replace only the last occurance of "union all" in input file with ";"
I tried with sed 's/union all/;/g' in my input file, it replaced in all lines of input file
Eg:
I need to replace only the last "union all" in the above with ";".
Thanks
Moderator's Comments:
Please use CODE tags as required by forum rules!
Last edited by RudiC; 02-03-2018 at 04:33 AM..
Reason: Added CODE tags.
Hi All,
How can i replace the n'th occurance in a file. ?
I have a property file like
EAR;_TrackingEAR;META-INF/application.xml;xml;context-root;1;valeur
EAR;_TrackingEAR;META-INF/application.xml;xml;context-root;2;valeur2... (2 Replies)
Hi
I have a file which contains the following two lines which are same But I would like to insert the value=8.8.8.8 in the 1st occurance line and value=9.9.9.9 in the 2nd occurance line.
<parameter name="TestIp1" value="">
<parameter name="TestIp1" value="">
Please suggest (1 Reply)
Hi,
I'm trying to match records using awk which contain only one occurance of my string, I know how to match one or more (+) but matching only one is eluding me without developing some convoluted bit of code. I was hoping there would be some simple pattern matching thing similar to '+' but... (9 Replies)
HI please let me know if there is any command to search and replace only the last occurence of a string in aline.
Eg:
" This cat is a cat with a tail longer of all cat."
I need to replace only the last "cat" in the above line.
thanks (3 Replies)
Hi,
I am looking for any script which can do the following.
have to read a pattern from fileA and copy it to fileB.
fileA:
...
...
Header
...
...
..p1
...
...
fileB:
....
....
Header (3 Replies)
Please help me, wasted hrs:wall:, to find this soulution:-
I need a command that will work on file (xml) and replace multiple occurrence (more than 2 times)
Examples
1. '==='
2. '===='
3. '======='
should be replaced by just '=='
Note :- single character should be replaced. (=... (13 Replies)
I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10 (4 Replies)
Hi,
I'm trying to match the front and back of a sequence. It works when there is an exact match (obviously), but I need the regex to be more flexible. When we get strings of nucleotides sometimes their prefixes and suffixes aren't exact matches. Sometimes there will be an extra letter and... (2 Replies)
Discussion started by: jdilts
2 Replies
LEARN ABOUT OSX
mpi_intercomm_merge
MPI_Intercomm_merge(3OpenMPI)MPI_Intercomm_merge(3OpenMPI)NAME
MPI_Intercomm_merge - Creates an intracommunicator from an intercommunicator.
SYNTAX C Syntax
#include <mpi.h>
int MPI_Intercomm_merge(MPI_Comm intercomm, int high,
MPI_Comm *newintracomm
Fortran Syntax
INCLUDE 'mpif.h'
MPI_INTERCOMM_MERGE(INTERCOMM, HIGH, NEWINTRACOMM, IERROR)
INTEGER INTERCOMM, NEWINTRACOMM, IERROR
LOGICAL HIGH
C++ Syntax
#include <mpi.h>
Intracomm Intercomm::Merge(bool high) const
INPUT PARAMETERS
intercomm Intercommunicator (type indicator).
high Used to order the groups of the two intracommunicators within comm when creating the new communicator (type indicator).
OUTPUT PARAMETERS
newintracomm
Created intracommunicator (type indicator).
IERROR Fortran only: Error status (integer).
DESCRIPTION
This function creates an intracommunicator from the union of the two groups that are associated with intercomm. All processes should pro-
vide the same high value within each of the two groups. If processes in one group provide the value high = false and processes in the other
group provide the value high = true, then the union orders the "low" group before the "high" group. If all processes provide the same high
argument, then the order of the union is arbitrary. This call is blocking and collective within the union of the two groups.
ERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ func-
tions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism
will be used to throw an MPI:Exception object.
Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for
I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be
used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error.
SEE ALSO
MPI_Intercomm_create
MPI_Comm_free
Open MPI 1.2 September 2006 MPI_Intercomm_merge(3OpenMPI)