Sponsored Content
Top Forums Shell Programming and Scripting awk pattern match and search in single statement Post 302428599 by Bruble on Thursday 10th of June 2010 10:23:50 AM
Old 06-10-2010
Code:
      *               |            |TABLE.                                         |V02.05 *
      * 02022010 |    JHH   |R10.2 SR8644 DYNAMICALLY SET       |V02.06 *
      *               |            |ACTIVITY FLAGS                            |V02.06 *
      *               |            |IPARM AMENDED TO INCLUDE OFFSET|V02.06 *
      *****************************************************************
V01.02
V01.02 01  FILLER                     PIC X(32)
V01.02     VALUE 'MHAA5J - CM_COSTELEMENT_SPLIT'.
V01.02     EXEC SQL
V01.02        INCLUDE MHRSCV01
V01.02     END-EXEC.
V01.02
V01.02 01  FILLER                     PIC X(32)
V01.02     VALUE 'MHAA5J - CM_DIV_PROD_ACTIVITY'.
V01.02     EXEC SQL
V01.02        INCLUDE MHRDAV01
V01.02     END-EXEC.

The first include must not be altered but the EXEC SQL .... END_EXEC statements containing the INCLUDE should be altered (Result shown below):

Code:
      *               |            |TABLE.                                         |V02.05 *
      * 02022010 |    JHH   |R10.2 SR8644 DYNAMICALLY SET       |V02.06 *
      *               |            |ACTIVITY FLAGS                            |V02.06 *
      *               |            |IPARM AMENDED TO INCLUDE OFFSET|V02.06 *
      *****************************************************************V01.02
V01.02 01  FILLER                     PIC X(32)
V01.02     VALUE 'MHAA5J - CM_COSTELEMENT_SPLIT'.
MIGAU1    EXEC SQL
MIGAU1       BEGIN DECLARE SECTION
MIGAU1    END-EXEC       
V01.02     EXEC SQL
V01.02        INCLUDE MHRSCV01
V01.02     END-EXEC.
MIGAU1    EXEC SQL
MIGAU1       END DECLARE SECTION
MIGAU1    END-EXEC       
V01.02
V01.02 01  FILLER                     PIC X(32)
V01.02     VALUE 'MHAA5J - CM_DIV_PROD_ACTIVITY'.
MIGAU1    EXEC SQL
MIGAU1       BEGIN DECLARE SECTION
MIGAU1    END-EXEC       
V01.02     EXEC SQL
V01.02        INCLUDE MHRDAV01
V01.02     END-EXEC.
MIGAU1    EXEC SQL
MIGAU1       END DECLARE SECTION
MIGAU1    END-EXEC

 

10 More Discussions You Might Find Interesting

1. IP Networking

List files that do not match the search pattern

I need to list the files that do not match the search pattern: Example: cat file1 This is how it should work cat file2 This is why I like Unix grep -option? Unix * (or some other command) returns file1 (1 Reply)
Discussion started by: olapxpert
1 Replies

2. UNIX for Dummies Questions & Answers

List files that do not match the search pattern

I need to list the files that do not match the search pattern: Example: cat file1 This is how it should work cat file2 This is why I like Unix grep -option? Unix * (or some other command) returns file1 (7 Replies)
Discussion started by: olapxpert
7 Replies

3. Shell Programming and Scripting

search files which doesnot match pattern ?

Hi I need a command to search files in a directory which does not match with pattern .. Plz send me this Ex : Test is directory and has some 10 files with different name all are with *.dat extension , need to search files which doesnot contain word "Dummy file". Thanks (6 Replies)
Discussion started by: madankumar
6 Replies

4. 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

5. 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

6. Shell Programming and Scripting

How to specify more then one pattern in a single mget statement of ftp command?

hi, i am using ftp command to get some files from a remote server. if the remote server contains files of different extension. abc.txt def.txt ghi.lst jkl.cnf is it possible to get all the three type of files in one ftp? i am using this ftp command $FTP $Remote_server <<_FTP1 ... (4 Replies)
Discussion started by: Little
4 Replies

7. Shell Programming and Scripting

Search Pattern and combine into single file

Hi Experts Please help me out with the following thing: 2 files and want the output file: {No for using FOR loop because I got 22 million lines} Tried that "It processes only 8000 records per hour" I need a faster way out !!! FileA: 9051 9052 9053 9054 9055 9056 9057 9058 9059 ... (5 Replies)
Discussion started by: navkanwal
5 Replies

8. Shell Programming and Scripting

Multiple pattern match and print the output in a single line

I need to match two patterns in a log file and need to get the next line of the one of the pattern (out of two patterns) that is matched, finally need to print these three values in a single line. Sample Log: 2013/06/11 14:29:04 <0999> (725102) Processing batch 02_1231324 2013/06/11... (4 Replies)
Discussion started by: rpm120
4 Replies

9. Shell Programming and Scripting

awk pattern match by looping through search patterns

Hi I am using Solaris 5.10 & ksh Wanted to loop through a pattern file by reading it and passing it to the awk to match that value present in column 1 of rawdata.txt , if so print column 1 & 2 in to Avlblpatterns.txt. Using the following code but it seems some mistakes and it is running for... (2 Replies)
Discussion started by: ananan
2 Replies

10. UNIX for Beginners Questions & Answers

Grep/awk using a begin search pattern and end search pattern

I have this fileA TEST FILE ABC this file contains ABC; TEST FILE DGHT this file contains DGHT; TEST FILE 123 this file contains ABC, this file contains DEF, this file contains XYZ, this file contains KLM ; I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
DH-EXEC-SUBST(1)						      dh-exec							  DH-EXEC-SUBST(1)

NAME
dh-exec-subst - Debhelper executable file substition scripts SYNOPSIS
#! /usr/bin/dh-exec src/libfoo-*.so.* debian/foo-plugins/usr/lib/foo/${DEB_HOST_MULTIARCH}/ DESCRIPTION
Being a sub-command of dh-exec(1), this program must not be ran directly, but through dh-exec, which automatically runs all available sub-commands if run bare; or explicitly with dh-exec --with=subst. It is a wrapper around the various other substitution helpers, and will pipe the input file through all the available substitution helpers. It is up to these scripts to do the actual work. When a helper fails to expand a variable within its input, it will leave it as-is, so that later in the pipeline it can perhaps be expanded by another program. SCRIPTS
dh-exec-subst-env Substitutes any of the available, exported environment variables into its input. It does not do any kind of filtering: whatever is available in the environment, will be available for substitution, however unsafe that may be. dh-exec-subst-multiarch Attempts to expand any of the variables known to dpkg-architecture(1), mostly useful for multi-arch support. The command will query dpkg-architecture(1) directly, and does not rely on environment variables set (as the called program will prefer already set environment variables anyway). ENVIRONMENT
DH_EXEC_SCRIPTDIR Indicates which directory the command-specific scripts should be sought for. If not specified, scripts will be searched for in /usr/share/dh-exec/. FILES
$DH_EXEC_SCRIPTDIR/dh-exec-subst-* The various scripts for the higher-level program. SEE ALSO
debhelper(1), dh-exec(1) AUTHOR
dh-exec-subst is copyright (C) 2011-2012 by Gergely Nagy <algernon@madhouse-project.org>. 2012-05-03 DH-EXEC-SUBST(1)
All times are GMT -4. The time now is 07:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy