10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I am able to grep multiple patterns which stored in a files. However, how could we replace the whole line with either the pattern or new string?
pattern_file: *Info in the () is not part of the pattern file. They are the intended name to replace the whole line after the pattern... (5 Replies)
Discussion started by: wxboo
2. Shell Programming and Scripting
I am trying to grep a variable with multiple lines with multiple patterns
below is the pattern list in a variable called "grouplst", each pattern is speerated by "|"
I need to use the patterns above to grep a... (2 Replies)
Discussion started by: ajetangay
3. Shell Programming and Scripting
I have a file containing list of strings like
and I have file having list of file names in a directory
Where j contains of a ,b,c,d are as follows
Pink (3 Replies)
Discussion started by: madabhg
4. Shell Programming and Scripting
I have to write one script that has to search a list of numbers in certain zipped files.
For eg. one file file1.txt contains the numbers. File1.txt contains 5,00,000 numbers and I have to search each number in zipped files(The number of zipped files are around 1000 each file is 5 MB)
I have... (10 Replies)
Discussion started by: vsachan
5. UNIX for Dummies Questions & Answers
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
6. Shell Programming and Scripting
I have a file with many rows.
I want to grep for multiple patterns from the file.
I want the lines which has both XX and ZZ.
I know I can get it like this.
grep XX file | grep YY
But... (10 Replies)
Discussion started by: tene
7. Shell Programming and Scripting
I'm trying to parse COBOL code to combine variables into one string. I have two variable names that get literals moved into them and I'd like to use sed, awk, or similar to find these lines and combine the variables into the final component. These variable names are always VAR1 and VAR2. For... (8 Replies)
Discussion started by: wilg0005
8. Shell Programming and Scripting
I have a file. I need to find multiple patterns in a row and need those rows to divert to new file.
I tried using grep -e / -E / -F options as given in man.
But its not working.
==> cat testgrep.txt
==>... (7 Replies)
Discussion started by: WillImm123
9. Shell Programming and Scripting
Can we grep multiple patterns in UNIX.
cat /x/y/oratab | grep -i "pattern1|pattern2" .... etc
I require the syntax for multiple patterns. | is not working as I explained in example.
Malay (4 Replies)
Discussion started by: malaymaru
10. UNIX for Dummies Questions & Answers
I want to get a list of all the files in the current directory that have two patterns. I can do first grep of one pattern and then with the output do the grep of the second pattern.
if the output of 1st pattern search results in many files, it is very difficult to do a grep of the 2nd pattern for... (1 Reply)
Discussion started by: tselvanin