How to find text from one file in another file and copy that text to a new file? (grep equivalent)How to...

How can the Zone of Truth spell be defeated without the caster knowing?

How do I reattach a shelf to the wall when it ripped out of the wall?

What language was spoken in East Asia before Proto-Turkic?

Is there an official tutorial for installing Ubuntu 18.04+ on a device with an SSD and an additional internal hard drive?

How to creep the reader out with what seems like a normal person?

How to have a sharp product image?

Don’t seats that recline flat defeat the purpose of having seatbelts?

How to make a pipeline wait for end-of-file or stop after an error?

"The cow" OR "a cow" OR "cows" in this context

Phrase for the opposite of "foolproof"

How would one muzzle a full grown polar bear in the 13th century?

How to stop co-workers from teasing me because I know Russian?

Size of electromagnet needed to replicate Earth's magnetic field

Fizzy, soft, pop and still drinks

Symbolic Multivariate Distribution

what is the sudo password for a --disabled-password user

Will tsunami waves travel forever if there was no land?

Seemingly unused edef prior to an ifx mysteriously affects the outcome of the ifx. Why?

What's the polite way to say "I need to urinate"?

Minor Revision with suggestion of an alternative proof by reviewer

Why is it that the natural deduction method can't test for invalidity?

Normal Map bad shading in Rendered display

Mjolnir's timeline from Thor's perspective

Is it possible to determine the symmetric encryption method used by output size?



How to find text from one file in another file and copy that text to a new file? (grep equivalent)


How to search for files and directories using a single find commandDifference between find and grep -lUsing grep to remove lines from a file which contain a string from another fileHow To Search & Replace From a Word to another in The Same Line?Find group of words in a text file and extract the line to new text fileCopy/move certain file types from subfolders to a common folderRobocopy: How to copy assets from multiple locations to a single location and maintain a logIs there a way to take file names and insert them on separate lines of text?Batch script to fetch each line from a .txt file as a string (more than one word in a line) and google search each string in a separate tab in chromeHow to loop through files named in a text file? Windows Server 2012






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have a file A which contains variable names, each on a separate line, and I want to search another file B. If a line from file B contains one of the variable names in file A, I want that line to be added to file C. This reply to another question demonstrates my desired effect, but uses Linux's grep command. (Or I'd be fine just adding the variable name itself, not the entire line containing it, to the new file.)










share|improve this question







New contributor




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
















  • 1





    What have you tried so far? SuperUser is not a free script writing service.

    – SimonS
    yesterday






  • 1





    meh. i want to post this before I go into weekend: (cat "C:fooFileB.txt")-match((cat "C:barFileA.txt")-join'|')>"C:xyFileC.txt"

    – SimonS
    yesterday


















0















I have a file A which contains variable names, each on a separate line, and I want to search another file B. If a line from file B contains one of the variable names in file A, I want that line to be added to file C. This reply to another question demonstrates my desired effect, but uses Linux's grep command. (Or I'd be fine just adding the variable name itself, not the entire line containing it, to the new file.)










share|improve this question







New contributor




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
















  • 1





    What have you tried so far? SuperUser is not a free script writing service.

    – SimonS
    yesterday






  • 1





    meh. i want to post this before I go into weekend: (cat "C:fooFileB.txt")-match((cat "C:barFileA.txt")-join'|')>"C:xyFileC.txt"

    – SimonS
    yesterday














0












0








0








I have a file A which contains variable names, each on a separate line, and I want to search another file B. If a line from file B contains one of the variable names in file A, I want that line to be added to file C. This reply to another question demonstrates my desired effect, but uses Linux's grep command. (Or I'd be fine just adding the variable name itself, not the entire line containing it, to the new file.)










share|improve this question







New contributor




puts 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 A which contains variable names, each on a separate line, and I want to search another file B. If a line from file B contains one of the variable names in file A, I want that line to be added to file C. This reply to another question demonstrates my desired effect, but uses Linux's grep command. (Or I'd be fine just adding the variable name itself, not the entire line containing it, to the new file.)







windows windows-10 command-line powershell






share|improve this question







New contributor




puts 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




puts 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




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









asked yesterday









putsputs

11




11




New contributor




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





New contributor





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






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








  • 1





    What have you tried so far? SuperUser is not a free script writing service.

    – SimonS
    yesterday






  • 1





    meh. i want to post this before I go into weekend: (cat "C:fooFileB.txt")-match((cat "C:barFileA.txt")-join'|')>"C:xyFileC.txt"

    – SimonS
    yesterday














  • 1





    What have you tried so far? SuperUser is not a free script writing service.

    – SimonS
    yesterday






  • 1





    meh. i want to post this before I go into weekend: (cat "C:fooFileB.txt")-match((cat "C:barFileA.txt")-join'|')>"C:xyFileC.txt"

    – SimonS
    yesterday








1




1





What have you tried so far? SuperUser is not a free script writing service.

– SimonS
yesterday





What have you tried so far? SuperUser is not a free script writing service.

– SimonS
yesterday




1




1





meh. i want to post this before I go into weekend: (cat "C:fooFileB.txt")-match((cat "C:barFileA.txt")-join'|')>"C:xyFileC.txt"

– SimonS
yesterday





meh. i want to post this before I go into weekend: (cat "C:fooFileB.txt")-match((cat "C:barFileA.txt")-join'|')>"C:xyFileC.txt"

– SimonS
yesterday










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});


}
});






puts 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%2fsuperuser.com%2fquestions%2f1429881%2fhow-to-find-text-from-one-file-in-another-file-and-copy-that-text-to-a-new-file%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








puts is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















puts is a new contributor. Be nice, and check out our Code of Conduct.













puts is a new contributor. Be nice, and check out our Code of Conduct.












puts is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Super User!


  • 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%2fsuperuser.com%2fquestions%2f1429881%2fhow-to-find-text-from-one-file-in-another-file-and-copy-that-text-to-a-new-file%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

Cannot install PyQt5 The Next CEO of Stack OverflowCannot install tcpreplay 3.4.4cannot...

Kapp-Putsch Acontecimentos | Outros artigos | Menu de navegação

Why did early computer designers eschew integers? The Next CEO of Stack OverflowWhat register...