replace first semicolon occurence
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Hi I have a logfile and I want to replace the first semicolon occurence, like:
head1;head2;head3;head4;head5
blabb;blabl;;blab;blabl;;bla
Desired output:
head1;head2;head3;head4;head5
blabb;blabl;blab;blabl;;bla
With regular expression how can select the first occurrence and replace for ";"
I have the next command in sed:
sed -i 's/;;/;/g'
but this one replace all the occurrences file. Is there another way to do?
sed regular-expression tr
add a comment |Â
up vote
0
down vote
favorite
Hi I have a logfile and I want to replace the first semicolon occurence, like:
head1;head2;head3;head4;head5
blabb;blabl;;blab;blabl;;bla
Desired output:
head1;head2;head3;head4;head5
blabb;blabl;blab;blabl;;bla
With regular expression how can select the first occurrence and replace for ";"
I have the next command in sed:
sed -i 's/;;/;/g'
but this one replace all the occurrences file. Is there another way to do?
sed regular-expression tr
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Hi I have a logfile and I want to replace the first semicolon occurence, like:
head1;head2;head3;head4;head5
blabb;blabl;;blab;blabl;;bla
Desired output:
head1;head2;head3;head4;head5
blabb;blabl;blab;blabl;;bla
With regular expression how can select the first occurrence and replace for ";"
I have the next command in sed:
sed -i 's/;;/;/g'
but this one replace all the occurrences file. Is there another way to do?
sed regular-expression tr
Hi I have a logfile and I want to replace the first semicolon occurence, like:
head1;head2;head3;head4;head5
blabb;blabl;;blab;blabl;;bla
Desired output:
head1;head2;head3;head4;head5
blabb;blabl;blab;blabl;;bla
With regular expression how can select the first occurrence and replace for ";"
I have the next command in sed:
sed -i 's/;;/;/g'
but this one replace all the occurrences file. Is there another way to do?
sed regular-expression tr
sed regular-expression tr
asked 12 mins ago
Mareyes
13611
13611
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
To make the substitution only act once, remove the /g
modifier:
s/;;/;/
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
To make the substitution only act once, remove the /g
modifier:
s/;;/;/
add a comment |Â
up vote
1
down vote
To make the substitution only act once, remove the /g
modifier:
s/;;/;/
add a comment |Â
up vote
1
down vote
up vote
1
down vote
To make the substitution only act once, remove the /g
modifier:
s/;;/;/
To make the substitution only act once, remove the /g
modifier:
s/;;/;/
answered 6 mins ago
choroba
25.3k44269
25.3k44269
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478975%2freplace-first-semicolon-occurence%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password