![]() ![]() So I have a big file with recurring sections, it looks something like this: repeats in the file. Using grep 217848 grep BIG, or grep 217848 grep BIG will only give you one return, even if there are. If there is a better way without grep, or even using python that would be helpful, I just resorted to using grep as I thought it would be faster than reading a file line by line with python. something like (i know this command doesn't work, just an example) grep -E 'a|b|c' -A1 'x|y|z' 1 Display multiple words into a single td tag display, html, html generation, multiple, newbies, tag, words Himanshu1 2 sed command to grep multiple. ![]() So my question is, is it possible to combine all of these into a single command? E.g. ![]() Now, lets suppose you do not know if the sentence was in uppercase or in lowercase, so ask grep to ignore case. grep 'sentence to look for' /home/user/docs/. First the easy case, you know the exact sentence, you are looking for, and you at least remember the folder where the file is. #Grep multiple strings windows#In a Windows PowerShell the alternative for grep is the Select-String command. The findstr command is a Windows grep equivalent in a Windows command-line prompt (CMD). I know that this can be done with grep -A1 'x' Look for a document, containing a given string. The grep command in Linux is widely used for parsing files and searching for useful data in the outputs of different commands. However, I also want to grep for the strings x, y and z, including the following line. I know that this can be done with grep -E 'a|b|c' I'm trying to grep 3 fields for the strings a, b and c. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |