Need to do SED filtering on a file
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Just wanted to remove last occurrence of ,
from the below file using SED
.
ubuntu@kops:/mujahid$ cat change-resource-record-sets.json
"Comment": "Update record to reflect new IP address of home router"
"Changes": [
"Action": "UPSERT"
"ResourceRecordSet":
"Name": " .summimak.online."
"Type": "A"
"TTL": 60
"ResourceRecords": [
"Value": 13.126.33.247 ,
"Value": 35.154.112.217 ,
]
]
sed json
add a comment |Â
up vote
0
down vote
favorite
Just wanted to remove last occurrence of ,
from the below file using SED
.
ubuntu@kops:/mujahid$ cat change-resource-record-sets.json
"Comment": "Update record to reflect new IP address of home router"
"Changes": [
"Action": "UPSERT"
"ResourceRecordSet":
"Name": " .summimak.online."
"Type": "A"
"TTL": 60
"ResourceRecords": [
"Value": 13.126.33.247 ,
"Value": 35.154.112.217 ,
]
]
sed json
Related: unix.stackexchange.com/questions/436683/â¦
â Kusalananda
Apr 11 at 9:34
yah ! i even went ahead with shell script,, upon which im getting stuck at this juncture.
â Mohd
Apr 11 at 9:44
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Just wanted to remove last occurrence of ,
from the below file using SED
.
ubuntu@kops:/mujahid$ cat change-resource-record-sets.json
"Comment": "Update record to reflect new IP address of home router"
"Changes": [
"Action": "UPSERT"
"ResourceRecordSet":
"Name": " .summimak.online."
"Type": "A"
"TTL": 60
"ResourceRecords": [
"Value": 13.126.33.247 ,
"Value": 35.154.112.217 ,
]
]
sed json
Just wanted to remove last occurrence of ,
from the below file using SED
.
ubuntu@kops:/mujahid$ cat change-resource-record-sets.json
"Comment": "Update record to reflect new IP address of home router"
"Changes": [
"Action": "UPSERT"
"ResourceRecordSet":
"Name": " .summimak.online."
"Type": "A"
"TTL": 60
"ResourceRecords": [
"Value": 13.126.33.247 ,
"Value": 35.154.112.217 ,
]
]
sed json
edited Apr 11 at 9:42
Jeff Schaller
31.1k846105
31.1k846105
asked Apr 11 at 9:28
Mohd
146114
146114
Related: unix.stackexchange.com/questions/436683/â¦
â Kusalananda
Apr 11 at 9:34
yah ! i even went ahead with shell script,, upon which im getting stuck at this juncture.
â Mohd
Apr 11 at 9:44
add a comment |Â
Related: unix.stackexchange.com/questions/436683/â¦
â Kusalananda
Apr 11 at 9:34
yah ! i even went ahead with shell script,, upon which im getting stuck at this juncture.
â Mohd
Apr 11 at 9:44
Related: unix.stackexchange.com/questions/436683/â¦
â Kusalananda
Apr 11 at 9:34
Related: unix.stackexchange.com/questions/436683/â¦
â Kusalananda
Apr 11 at 9:34
yah ! i even went ahead with shell script,, upon which im getting stuck at this juncture.
â Mohd
Apr 11 at 9:44
yah ! i even went ahead with shell script,, upon which im getting stuck at this juncture.
â Mohd
Apr 11 at 9:44
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Answers are available for this, but you can use :
sed 's/(.*),/1/'
This removes the last comma on each line, not the last comma in the whole file.
â choroba
Apr 11 at 9:36
yes it removes from entire file,, i want it to be removed only from last occurance in the entire file.
â Mohd
Apr 11 at 9:39
the answer is more complicated than i thought...here is the same question : unix.stackexchange.com/questions/162377/â¦
â mazs
Apr 11 at 9:43
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Answers are available for this, but you can use :
sed 's/(.*),/1/'
This removes the last comma on each line, not the last comma in the whole file.
â choroba
Apr 11 at 9:36
yes it removes from entire file,, i want it to be removed only from last occurance in the entire file.
â Mohd
Apr 11 at 9:39
the answer is more complicated than i thought...here is the same question : unix.stackexchange.com/questions/162377/â¦
â mazs
Apr 11 at 9:43
add a comment |Â
up vote
0
down vote
Answers are available for this, but you can use :
sed 's/(.*),/1/'
This removes the last comma on each line, not the last comma in the whole file.
â choroba
Apr 11 at 9:36
yes it removes from entire file,, i want it to be removed only from last occurance in the entire file.
â Mohd
Apr 11 at 9:39
the answer is more complicated than i thought...here is the same question : unix.stackexchange.com/questions/162377/â¦
â mazs
Apr 11 at 9:43
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Answers are available for this, but you can use :
sed 's/(.*),/1/'
Answers are available for this, but you can use :
sed 's/(.*),/1/'
answered Apr 11 at 9:35
mazs
2,5151522
2,5151522
This removes the last comma on each line, not the last comma in the whole file.
â choroba
Apr 11 at 9:36
yes it removes from entire file,, i want it to be removed only from last occurance in the entire file.
â Mohd
Apr 11 at 9:39
the answer is more complicated than i thought...here is the same question : unix.stackexchange.com/questions/162377/â¦
â mazs
Apr 11 at 9:43
add a comment |Â
This removes the last comma on each line, not the last comma in the whole file.
â choroba
Apr 11 at 9:36
yes it removes from entire file,, i want it to be removed only from last occurance in the entire file.
â Mohd
Apr 11 at 9:39
the answer is more complicated than i thought...here is the same question : unix.stackexchange.com/questions/162377/â¦
â mazs
Apr 11 at 9:43
This removes the last comma on each line, not the last comma in the whole file.
â choroba
Apr 11 at 9:36
This removes the last comma on each line, not the last comma in the whole file.
â choroba
Apr 11 at 9:36
yes it removes from entire file,, i want it to be removed only from last occurance in the entire file.
â Mohd
Apr 11 at 9:39
yes it removes from entire file,, i want it to be removed only from last occurance in the entire file.
â Mohd
Apr 11 at 9:39
the answer is more complicated than i thought...here is the same question : unix.stackexchange.com/questions/162377/â¦
â mazs
Apr 11 at 9:43
the answer is more complicated than i thought...here is the same question : unix.stackexchange.com/questions/162377/â¦
â mazs
Apr 11 at 9:43
add a comment |Â
Â
draft saved
draft discarded
Â
draft saved
draft discarded
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%2f436962%2fneed-to-do-sed-filtering-on-a-file%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
Related: unix.stackexchange.com/questions/436683/â¦
â Kusalananda
Apr 11 at 9:34
yah ! i even went ahead with shell script,, upon which im getting stuck at this juncture.
â Mohd
Apr 11 at 9:44