Sponsored Content
Top Forums Shell Programming and Scripting How to grep a pattern having value greater than 123 in a file? Post 302523930 by 116@434 on Friday 20th of May 2011 09:54:35 AM
Old 05-20-2011
Try this code:

Code:
 
grep "12[4-9][0-9]*" filename

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Grep a pattern in gz file

I have a set of .gz files. I need to grep a pattern and need to find out the file in which that pattern occurs. zgrep in not available in my server.Any other options available for searching a pattern without unzipping the .gz files. (2 Replies)
Discussion started by: rprajendran
2 Replies

2. Shell Programming and Scripting

grep for greater than 12 chars

Hi, is there any way in grep to grep for a certain number of characters? For example I have a list of customerIDs, I want to grep for all greater than 12 characters? (2 Replies)
Discussion started by: borderblaster
2 Replies

3. Shell Programming and Scripting

Need to Grep or awk a logfile for greater than value

Hello all Hoping someone would be kind enough to suggest a solution to a problem i have, and see if maybe i can even do this without a script. Essentially i have a very large log file, and within it each line had a value called TTMT, and it records a variable number in the following way, so... (6 Replies)
Discussion started by: 1905
6 Replies

4. Shell Programming and Scripting

grep /target greater than time period??

Hey guys, I'm fairly new at unix shell scripting and I have a quick question. Quick overview I devolped a script where I generate a file ..and I want to grep any time greater than 30 minutes. What i do is runa command to generates the below and puts it into a file: I run ./ggsci << endit... (4 Replies)
Discussion started by: nomiezvr4
4 Replies

5. Shell Programming and Scripting

script to grep a pattern from file compare contents with another file and replace

Hi All, Need help on this I have 2 files one file file1 which has several entries as : define service{ hostgroup_name !host1,!host5,!host6,.* service_description check_nrpe } define service{ hostgroup_name !host2,!host4,!host6,.* service_description check_opt } another... (2 Replies)
Discussion started by: namitai
2 Replies

6. UNIX for Dummies Questions & Answers

look for file size greater than "0" of specific pattern and move those to another directory

Hi , i have some files of specific pattern ...i need to look for files which are having size greater than zero and move those files to another directory.. Ex... abc_0702, abc_0709, abc_782 abc_1234 ...etc need to find out which is having the size >0 and move those to target directory..... (7 Replies)
Discussion started by: dssyadav
7 Replies

7. UNIX for Dummies Questions & Answers

Grep lines with numbers greater than 2 digits at the end of the line

I'm trying to grep lines where the digits at the end of each line are greater than digits. Tried this but it will only allow me to specify 2 digits. Any ideas would greatly be appreciated. grep -i '\<\{3,4,5\}\>' file ---------- Post updated at 05:58 PM ---------- Previous update was at 05:41... (1 Reply)
Discussion started by: jimmyf
1 Replies

8. Shell Programming and Scripting

Grep a file pattern in another

Hi I'm new to the forum, so I'd apologize for any error in the format of the post. I'm trying to find a file content in another one using: grep -w -f file1 file2 file1 GJA7 TSC file 2 GJC1 GJA7 TSC1 TSC (11 Replies)
Discussion started by: flyfisherman
11 Replies

9. UNIX for Dummies Questions & Answers

Grep SQL output file for greater than number.

Hi, This is my first post. I have a korn shell script which outputs a select statment to a file. There is only one column and one row which contains a record count of the select statement. The select statement looks something like this: SELECT COUNT(some_field) AS "count_value" ... (2 Replies)
Discussion started by: MurdocUK
2 Replies

10. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies
ZGREP(1)						      General Commands Manual							  ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 11:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy