Hello,
I have a text file which contains a list of strings which I want to grep from another file where these strings occur and print out only these lines.
I had earlier used the grep command
Quote:
grep -f File1 File2
where File1 was the file containing the strings to be grepped (Source File) and File2 the Target File from which the strings ha
Hello,
I would like to kindly ask you for help. I have a file with some lines in one row separated by semicolon. I need to find out, if the line I have in different variable is included in this file.
I am trying to figure out the correct syntax to find two strings, the entire part of each string, anywhere (doesn't have to be near each other) in a file. So any file that has both foo and say the number 321, doesn't have to be alone and can be a substring should match. I've tried the following without much luck:
grep 'foo\|321' *
grep 'foo|321'
Pipe binary file matches grep results to file
I am using grep to match a pattern, but the output is strange.
Code:
$ grep -r -o "pattern" *
Gives me:
Code:
Binary file foo1 matches
Binary file foo2 matches
Binary file foo3 matches
To find the lines before/after, I then have to use the following on each file:
Code:
$ strings foo1 | grep -A1 -B1 "pattern"
Ho
Hi, every one!
I have a file with multiple strings.
file1
HTML Code:
ATQRGNE
ASQGVKFTE
ASSQYRDRGGLET
SPEQGARSDE
ASSRDFTDT
ASSYSGGYE
ASSYTRLWNTGE
ASQGHNTD
PSLGGGNQPQH
SLDRDSYNEQF
I want to grep each string in hundreds of files in the same directory, further, I want to find out the string which occurs in more than 50 files.
Can I use grep in awk to do that?
Hi All
I'm having a problem grep'ing files for a certain string on my server. The command I'm using is:
find .
Solaris, ksh
I have a .csv file I am trying to clean up before loading into the database. The file contains comma separated columns that have leading spaces which I need to remove. The trouble is, some columns that should not be touched are strings which happen to have the same pattern in them.
I have several (427 to be precise) text files with a million lines each containing 31 numbers separated be spaces (possible double spaces). However there might be some data corruption and there may be lines containing junk.
I now want to check if every line satisfies the property of containing 31 items separated by spaces (I assume that those items are numbers.
Hi
Here is the problem ( Exercise 3-3, Using The Shell of The Unix Programming Environment, Kerninghan, Pike, 3rd edition ):
Predict what each of the following grep commands will do, and then verify your understanding.
Code:
grep \$
grep \\$
grep \\\$
grep '\$'
grep '\'$'
grep \\
grep \\\\
grep "\$"
grep '"$'
grep "$"
A file containing these command