Need to do SED filtering on a file

The name of the pictureThe name of the pictureThe name of the pictureClash 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 ,
]


]







share|improve this question






















  • 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














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 ,
]


]







share|improve this question






















  • 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












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 ,
]


]







share|improve this question














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 ,
]


]









share|improve this question













share|improve this question




share|improve this question








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
















  • 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










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Answers are available for this, but you can use :



sed 's/(.*),/1/'





share|improve this answer




















  • 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










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















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






























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/'





share|improve this answer




















  • 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














up vote
0
down vote













Answers are available for this, but you can use :



sed 's/(.*),/1/'





share|improve this answer




















  • 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












up vote
0
down vote










up vote
0
down vote









Answers are available for this, but you can use :



sed 's/(.*),/1/'





share|improve this answer












Answers are available for this, but you can use :



sed 's/(.*),/1/'






share|improve this answer












share|improve this answer



share|improve this answer










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
















  • 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












 

draft saved


draft discarded


























 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay