![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pattern matching in file and then display 10 lines above every time | namishtiwari | Shell Programming and Scripting | 30 | 04-13-2009 11:40 AM |
| pattern matching | mercuryshipzz | Shell Programming and Scripting | 4 | 01-14-2008 11:01 PM |
| Reading lines in a file matching a pattern | torenji | Shell Programming and Scripting | 4 | 10-25-2007 04:15 AM |
| Search file for pattern and grab some lines before pattern | frustrated1 | Shell Programming and Scripting | 2 | 12-22-2005 03:41 PM |
| Pattern matching sed | leemjesse | Shell Programming and Scripting | 3 | 03-23-2005 04:06 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
pattern matching over more lines
hi, i have a text file wich contains following informations:
1 Record 90 in base GUJA_2008 (Created: 2008-01-14 19:00:38, Modified: 2008-01-15 18:54:33) 1 YADM_20080101_A91645666_A91645666 4 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645666G001.jff 1 Record 91 in base GUJA_2008 (Created: 2008-01-14 19:00:38, Modified: 2008-01-15 18:55:36) 1 YADM_20080101_A91645690_A91645690 2 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645690G001.jff 1 Record 92 in base GUJA_2008 (Created: 2008-01-14 19:00:38, Modified: 2008-01-15 18:55:36) 1 YADM_20080101_A91645695_A91645695 1 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645695G001.jff 1 Record 93 in base GUJA_2008 (Created: 2008-01-14 19:00:38, Modified: 2008-01-16 16:13:13) 1 YADM_20080101_A91645701_A91645701 1 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645701G001.jff 3 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645701G002.jff 1 Record 94 in base GUJA_2008 (Created: 2008-01-14 19:00:38, Modified: 2008-01-15 18:55:36) 1 YADM_20080101_A91645705_A91645705 1 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645705G001.jff 1 Record 95 in base GUJA_2008 (Created: 2008-01-14 19:00:38, Modified: 2008-01-15 18:55:36) 1 YADM_20080101_A91645722_A91645722 1 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645722G001.jff 1 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645722G002.jff 1 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645722G003.jff 1 Record 96 in base GUJA_2008 (Created: 2008-01-14 19:00:38, Modified: 2008-01-15 18:55:36) 1 YADM_20080101_A91645756_A91645756 1 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645756G001.jff Now i want to write a script which is searching between the lines Record... If a *.jff line has a number, at the front of the line, which is greater than 1, then the line itself and the line after the "record.. line" for example, "YADM_20080101_A91645666_A91645666" should be printed. The file should look like this after the pattern: 1 YADM_20080101_A91645666_A91645666 4 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645666G001.jff 1 YADM_20080101_A91645690_A91645690 2 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645690G001.jff 1 YADM_20080101_A91645701_A91645701 3 2008/01/15/ADM.ADM/20080101.ADM.ADM.A91645701G002.jff is anyone able to help me? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|