Sponsored Content
Top Forums Shell Programming and Scripting Only Regex pattern match help Post 302887373 by balajesuri on Friday 7th of February 2014 04:47:28 AM
Old 02-07-2014
Code:
[user@host ~]$ cat file
[26/Jan/2014:09:47:34 +0000] "GET /etc/designs/dlg/clientlibs/commons/base/img/close-icon.png HTTP/1.1" 500
[26/Jan/2014:09:47:34 +0000] "GET /etc/designs/dlg/clientlibs/commons/base/img/close-icon.png HTTP/1.1" 200 587
[26/Jan/2014:09:47:34 +0000] "GET /etc/designs/dlg/clientlibs/commons/base/img/close-icon.png HTTP/1.1" 5020 1221 abcd123
[26/Jan/2014:09:47:34 +0000] "GET /etc/designs/dlg/clientlibs/commons/base/img/close-icon.png HTTP/1.1" 531 206 abcd123
[26/Jan/2014:09:47:34 +0000] "GET /etc/designs/dlg/clientlibs/commons/base/img/close-icon.png HTTP/1.1" 5991 abcd123
[26/Jan/2014:09:47:34 +0000] "GET /etc/designs/dlg/clientlibs/commons/base/img/close-icon.png HTTP/1.1" 300 abcd123
[user@host ~]$ egrep " 5[0-9][0-9]( |$)" file
[26/Jan/2014:09:47:34 +0000] "GET /etc/designs/dlg/clientlibs/commons/base/img/close-icon.png HTTP/1.1" 500
[26/Jan/2014:09:47:34 +0000] "GET /etc/designs/dlg/clientlibs/commons/base/img/close-icon.png HTTP/1.1" 200 587
[26/Jan/2014:09:47:34 +0000] "GET /etc/designs/dlg/clientlibs/commons/base/img/close-icon.png HTTP/1.1" 531 206 abcd123
[user@host ~]$

This User Gave Thanks to balajesuri For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Match first pattern first then extract second pattern match

My input file: <accession>Q91G55</accession> <name>043L_IIV6</name> <protein> <recommendedName> <location> <position position="294"/> </location> <fullName>Uncharacterized protein 043L</fullName> <accession>P18556</accession> <name>1106L_ASFB7</name> <protein> <recommendedName>... (5 Replies)
Discussion started by: patrick87
5 Replies

2. Shell Programming and Scripting

AWK match $1 $2 pattern in file 1 to $1 $2 pattern in file2

Hi, I have 2 files that I have modified to basically match each other, however I want to determine what (if any) line in file 1 does not exist in file 2. I need to match column $1 and $2 as a single string in file1 to $1 and $2 in file2 as these two columns create a match. I'm stuck in an AWK... (9 Replies)
Discussion started by: right_coaster
9 Replies

3. Shell Programming and Scripting

Need one liner to search pattern and print everything expect 6 lines from where pattern match made

i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies

4. Shell Programming and Scripting

Awk to match a pattern and perform a search after the first pattern

Hello Guyz I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline ABC DEF LMN EFG HIJ LMN OPQ In the above text i need to... (8 Replies)
Discussion started by: RickCharles
8 Replies

5. UNIX for Dummies Questions & Answers

Match Pattern after certain pattern and Print words next to Pattern

Hi experts , im new to Unix,AWK ,and im just not able to get this right. I need to match for some patterns if it matches I need to print the next few words to it.. I have only three such conditions to match… But I need to print only those words that comes after satisfying the first condition..... (2 Replies)
Discussion started by: 100bees
2 Replies

6. Shell Programming and Scripting

PHP - Regex for matching string containing pattern but without pattern itself

The sample file: dept1: user1,user2,user3 dept2: user4,user5,user6 dept3: user7,user8,user9 I want to match by '/^dept2.*/' but don't want to have substring 'dept2:' in output. How to compose such regex? (8 Replies)
Discussion started by: urello
8 Replies

7. Shell Programming and Scripting

Regex: print matched line and exact pattern match

Hi experts, I have a file with regexes which is used for automatic searches on several files (40+ GB). To do some postprocessing with the grep result I need the matching line as well as the match itself. I know that the latter could be achieved with grep's -o option. But I'm not aware of a... (2 Replies)
Discussion started by: stresing
2 Replies

8. Shell Programming and Scripting

Rearrange or replace only the second line after pattern match or pattern match

Im using the command below , but thats not the output that i want. it only prints the odd and even numbers. awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}' Im hoping for something like this file1: Text hi this is just a test text1 text2 text3 text4 text5 text6 Text hi... (2 Replies)
Discussion started by: invinzin21
2 Replies

9. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies

10. Shell Programming and Scripting

Sendmail K command regex: adding exclusion/negative lookahead to regex -a@MATCH

I'm trying to get some exclusions into our sendmail regular expression for the K command. The following configuration & regex works: LOCAL_CONFIG # Kcheckaddress regex -a@MATCH +<@+?\.++?\.(us|info|to|br|bid|cn|ru) LOCAL_RULESETS SLocal_check_mail # check address against various regex... (0 Replies)
Discussion started by: RobbieTheK
0 Replies
img-window(3tk) 														   img-window(3tk)

NAME
img-window - Img, Tk Windows (window) SYNOPSIS
package require Tk package require img::window ?1.3? image create photo ?name? ?options? DESCRIPTION
The package img::window is a sub-package of Img. It can be loaded as a part of the complete Img support, via package require Img, or on its own, via package require img::window. Like all packages of Img it does not provide new commands, but extends the existing Tk command image. More specifically img::window extends Tk's photo image type. The name of the new format handler is window. This handler does not provide additional configuration options. This handler is special. Instead of reading or writing image data from a file or string it allows the embedding of a Tk widget into the photo image. In other words, it takes a snapshot of the contents of a Tk window. All of the above means that in a call like image create photo ?name? ?options? [1] Image data in window format (option -data) is detected automatically. Image data is considered to be in the window format if the value given to option -data is the name of an existing Tk window. Note that the standard option -file is not supported by this handler. [2] The format name window is recognized by the option -format. SEE ALSO
img-bmp, img-gif, img-ico, img-intro, img-jpeg, img-pcx, img-pixmap, img-png, img-ppm, img-ps, img-sgi, img-sun, img-tga, img-tiff, img- window, img-xbm, img-xpm KEYWORDS
image handling, tk, window COPYRIGHT
Copyright (c) 1995-2003 Jan Nijtmans <nijtmans@users.sourceforge.com> Img 1.3 img-window(3tk)
All times are GMT -4. The time now is 04:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy