How to grep for a pattern followed by a number and print to file if number than x,Print a text file from a...

Does French have the English "short i" vowel?

Dad jokes are fun

Is this homebrew "Cactus Grenade" cantrip balanced?

Why did other houses not demand this?

Freedom of Speech and Assembly in China

Why isn't Tyrion mentioned in the in-universe book "A Song of Ice and Fire"?

Count all vowels in string

How to let other coworkers know that I don't share my coworker's political views?

Is there an idiom that means that you are in a very strong negotiation position in a negotiation?

Would Buddhists help non-Buddhists continuing their attachments?

Is it legal to have an abortion in another state or abroad?

A burglar's sunglasses, a lady's odyssey

...And they were stumped for a long time

Testing using real data of the customer

How would a developer who mostly fixed bugs for years at a company call out their contributions in their CV?

One word for 'the thing that attracts me'?

How can I properly write this equation in Latex?

Navigating a quick return to previous employer

Security vulnerabilities of POST over SSL

3 prong range outlet

Why would a rational buyer offer to buy with no conditions precedent?

Gravitational Force Between Numbers

Why does the hash of infinity have the digits of π?

Why was this character made Grand Maester?



How to grep for a pattern followed by a number and print to file if number than x,


Print a text file from a line number to another after searching for the linesGrep multiple patterns and print a different number of lines below each of the patterns?grep all the lines in a file and write line to a file from the pattern matching pointGrep for the closest occurrence of line before patternhow to grep a tag value in xml file and print another two tag values in same xml fileGrep pattern, and pattern within patternHow can I do a stack trace using grep and regex?Print non consecutive lines from file given line number listGrep latest file for string and alert / email if foundExtract lines from a file with a value,whose parameter greater than 100, with grep and awk






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I have a file that looks like this:




Thispeculiarpattern(1.00);thatpeculiarpattern(0.90);....
Thispeculiarpattern(0.73);thatpeculiarpattern(0.15);...................



Somerandomtext(0.81); somemorerandomtext(0.79):.................................
Somerandomtext(0.62); somemorerandomtext(0.04):..............
Herewegoagain(0.93);Herewegoyetagain(0.48);....
Herewegoagain(0.71);Herewegoyetagain(0.87);....




and I would like an output like this:




Thispeculiarpattern(1.00);thatpeculiarpattern(0.90);....
Somerandomtext(0.81); somemorerandomtext(0.79):....
Herewegoagain(0.71);Herewegoyetagain(0.87);....




I.e, I want all lines output to file IF they contain either "Thispeculiarpattern", "Somerandomtext" or "Herewegoyetagain" which MUST then be followed by a parenthesis with a value of 0.8 or above.










share|improve this question







New contributor



Christoffer Bugge Harder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 1





    But your output has value less than 0.8.

    – dedowsdi
    14 mins ago


















0















I have a file that looks like this:




Thispeculiarpattern(1.00);thatpeculiarpattern(0.90);....
Thispeculiarpattern(0.73);thatpeculiarpattern(0.15);...................



Somerandomtext(0.81); somemorerandomtext(0.79):.................................
Somerandomtext(0.62); somemorerandomtext(0.04):..............
Herewegoagain(0.93);Herewegoyetagain(0.48);....
Herewegoagain(0.71);Herewegoyetagain(0.87);....




and I would like an output like this:




Thispeculiarpattern(1.00);thatpeculiarpattern(0.90);....
Somerandomtext(0.81); somemorerandomtext(0.79):....
Herewegoagain(0.71);Herewegoyetagain(0.87);....




I.e, I want all lines output to file IF they contain either "Thispeculiarpattern", "Somerandomtext" or "Herewegoyetagain" which MUST then be followed by a parenthesis with a value of 0.8 or above.










share|improve this question







New contributor



Christoffer Bugge Harder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 1





    But your output has value less than 0.8.

    – dedowsdi
    14 mins ago














0












0








0








I have a file that looks like this:




Thispeculiarpattern(1.00);thatpeculiarpattern(0.90);....
Thispeculiarpattern(0.73);thatpeculiarpattern(0.15);...................



Somerandomtext(0.81); somemorerandomtext(0.79):.................................
Somerandomtext(0.62); somemorerandomtext(0.04):..............
Herewegoagain(0.93);Herewegoyetagain(0.48);....
Herewegoagain(0.71);Herewegoyetagain(0.87);....




and I would like an output like this:




Thispeculiarpattern(1.00);thatpeculiarpattern(0.90);....
Somerandomtext(0.81); somemorerandomtext(0.79):....
Herewegoagain(0.71);Herewegoyetagain(0.87);....




I.e, I want all lines output to file IF they contain either "Thispeculiarpattern", "Somerandomtext" or "Herewegoyetagain" which MUST then be followed by a parenthesis with a value of 0.8 or above.










share|improve this question







New contributor



Christoffer Bugge Harder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I have a file that looks like this:




Thispeculiarpattern(1.00);thatpeculiarpattern(0.90);....
Thispeculiarpattern(0.73);thatpeculiarpattern(0.15);...................



Somerandomtext(0.81); somemorerandomtext(0.79):.................................
Somerandomtext(0.62); somemorerandomtext(0.04):..............
Herewegoagain(0.93);Herewegoyetagain(0.48);....
Herewegoagain(0.71);Herewegoyetagain(0.87);....




and I would like an output like this:




Thispeculiarpattern(1.00);thatpeculiarpattern(0.90);....
Somerandomtext(0.81); somemorerandomtext(0.79):....
Herewegoagain(0.71);Herewegoyetagain(0.87);....




I.e, I want all lines output to file IF they contain either "Thispeculiarpattern", "Somerandomtext" or "Herewegoyetagain" which MUST then be followed by a parenthesis with a value of 0.8 or above.







grep






share|improve this question







New contributor



Christoffer Bugge Harder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question







New contributor



Christoffer Bugge Harder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question






New contributor



Christoffer Bugge Harder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked 28 mins ago









Christoffer Bugge HarderChristoffer Bugge Harder

1




1




New contributor



Christoffer Bugge Harder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




Christoffer Bugge Harder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










  • 1





    But your output has value less than 0.8.

    – dedowsdi
    14 mins ago














  • 1





    But your output has value less than 0.8.

    – dedowsdi
    14 mins ago








1




1





But your output has value less than 0.8.

– dedowsdi
14 mins ago





But your output has value less than 0.8.

– dedowsdi
14 mins ago










0






active

oldest

votes












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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Christoffer Bugge Harder is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f520311%2fhow-to-grep-for-a-pattern-followed-by-a-number-and-print-to-file-if-number-than%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Christoffer Bugge Harder is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Christoffer Bugge Harder is a new contributor. Be nice, and check out our Code of Conduct.













Christoffer Bugge Harder is a new contributor. Be nice, and check out our Code of Conduct.












Christoffer Bugge Harder is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f520311%2fhow-to-grep-for-a-pattern-followed-by-a-number-and-print-to-file-if-number-than%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...