I have a bit of javascript
function hasSpaces(name)
{
if(name.search(/^\s*/) != -1){
alert(name);
name.replace((/^\s*/, "~"))
alert(name);
}
return name;
} ... (2 Replies)
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)
There is scenario that i have to replace a pattern at the first 5 occurance in a file. say i need to replace 'abc' by 'xyz' at its first 5 occurance in a file a.txt,
can anybody help me how it can be done, i can do complete replacement of the pattern using sed throughtout the file. (1 Reply)
Okay, title is kind of confusion, but basically, I have a lot of scripts on a server that I need to replace a ps command, however, the new ps command I'm trying to replace the current one with pipes to sed at one point. So now I am attempting to create another script that replaces that line.
... (1 Reply)
how to delete/replace the the odd occurance of a pattern say newline character "\n"
a,b,c,d
e,f
g, h, i, j, k, l
m,n
1, 2, 3, 4,
5, 6
1, 3, 4, 5, 6, 7
the output should be
a,b,c,de,f
g, h, i, j, k, lm,n
1, 2, 3, 4,5, 6
1, 3, 4, 5, 6, 7 (4 Replies)
I want to replace every 2nd occurance of a string/character from a line.
ababacbsbddbsbbcbdbssb
i want to replace every s2nd b with @ like below
should be like
aba@acbs@ddbs@bc@dbss@ (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)