I am trying to find pattern between two words but unable to get that pattern..


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users I am trying to find pattern between two words but unable to get that pattern..
# 1  
Old 09-09-2008
I am trying to find pattern between two words but unable to get that pattern..

HI....

It's fallow up file ..
#./show.sh click enter button.. i am gettng the fallowup file. [like logs files] its keep on running every time why because there are lots of users working on it.

In that file i want to search pattern between two words
for ex:
SELECT DISTINCT publisher.asset_id AS asset_id, publisher.name AS name, publisher.status AS status, publisher.site_location AS site_location, publisher.site_name AS site_name, publisher.site_code AS site_code FROM access_control, publisher WHERE access_control.asset_id = publisher.asset_id AND access_control.network_id = 525 AND publisher.name != 'SYSTEM' AND publisher.status = 'A' ORDER BY publisher.name....... This is the pattern it's comming somewhere in that file.

I want that pattern ? how to find out that one?


i executed with sed comm

sed -n 's/select\distinct\publiser.asset_id/,/order\by\publiser.name/' but it'not working

Any help would be appreciated

Last edited by ksr.test; 09-09-2008 at 10:13 AM..
# 2  
Old 09-09-2008
awk '/select distinct publisher\.asset_id/,/order by publisher\.name/'
# 3  
Old 09-09-2008
can we send unix variables as input for awk body & how?
# 4  
Old 09-09-2008
go through the awk man page.. you will find everything...
# 5  
Old 09-09-2008
how to select a field value of a record and store in unix user variable
# 6  
Old 09-09-2008
Quote:
Originally Posted by kakarla666
how to select a field value of a record and store in unix user variable
give some example..
or sample input and output..
# 7  
Old 09-09-2008
Network

Edit: Oh another Hijacker - didn't notice at first; deleted the post's content! Smilie

Last edited by zaxxon; 09-09-2008 at 11:52 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find a pattern and traverse left and pick something from another pattern

I have a Text like below , Detailed Table Information Table(tableName:a1, dbName:default, owner:eedc_hdp_s_d-itm-e, createTime:1520514151, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:, location:hdfs://DBDP-Dev/apps/hive/warehouse/a1,... (6 Replies)
Discussion started by: nv186000
6 Replies

2. Shell Programming and Scripting

sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern

The intended result should be : PDF converters 'empty line' gpdftext and pdftotext?xml version="1.0"?> xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies

3. UNIX for Dummies Questions & Answers

Find pattern suffix matching pattern

Hi, I am trying to get a result out of this but fails please help. Have two files /tmp/1 & /tmp/hosts. /tmp/1 IP=123.456.789.01 WAS_HOSTNAME=abcdefgh.was.tb.dsdc /tmp/hosts 123.456.789.01 I want this result in /tmp/hosts if hostname is already there dont want duplicate entry. ... (5 Replies)
Discussion started by: rajeshwebspere
5 Replies

4. Shell Programming and Scripting

Find all matching words in text according to pattern

Hello dear Unix shell professionals, I am desperately trying to get a seemingly simple logic to work. I need to extract words from a text line and save them in an array. The text can look anything like that: aaaaaaa${important}xxxxxxxx${important2}ooooooo${importantstring3}...I am handicapped... (5 Replies)
Discussion started by: Grünspanix
5 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. UNIX for Dummies Questions & Answers

Find next line based on pattern, if it is similar pattern skip it

Hi, I am able to get next line if it is matching a particular pattern. But i need a way to skip if next line also matches same pattern.. For example: No Records No Records Records found got it Records found Now i want to find 'Records found' after 'No Records' pattern matches.. ... (5 Replies)
Discussion started by: nagpa531
5 Replies

7. Shell Programming and Scripting

Find required files by pattern in xml files and the change the pattern on Linux

Hello, I need to find all *.xml files that matched by pattern on Linux. I need to have written the file name on the screen and then change the pattern in the file just was found. For instance. I can start the script with arguments for keyword and for value, i.e script.sh keyword... (1 Reply)
Discussion started by: yart
1 Replies

8. Shell Programming and Scripting

Replace all the words containing a particular pattern

Hi Please help with this one.. I have a file...I need to replace all the words containing a particular pattern say "xyz' and replace the entire containing xyz with abc.. Before xyzwork connect connect xyz disconnect raxyz After the operation i want something like below: abc... (4 Replies)
Discussion started by: ningy
4 Replies

9. Shell Programming and Scripting

sed: Find start of pattern and extract text to end of line, including the pattern

This is my first post, please be nice. I have tried to google and read different tutorials. The task at hand is: Input file input.txt (example) abc123defhij-E-1234jslo 456ujs-W-abXjklp From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Discussion started by: TestTomas
5 Replies

10. Shell Programming and Scripting

search a pattern and if pattern found insert new pattern at the begining

I am trying to do some thing like this .. In a file , if pattern found insert new pattern at the begining of the line containing the pattern. example: in a file I have this. gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin if i find feedthru_pin want to insert !! at the... (7 Replies)
Discussion started by: pitagi
7 Replies
Login or Register to Ask a Question