Sponsored Content
Full Discussion: awk with multiple controls
Top Forums Shell Programming and Scripting awk with multiple controls Post 302160957 by sickboy on Wednesday 23rd of January 2008 08:15:04 AM
Old 01-23-2008
awk with multiple controls

Hi guys,

I have a file which is like this

Code:
020-10136044 07-11-26 15:31:22 TRXRMP TCMAGT82TCM		  LHFE1G76006AK3
020-10136044 07-11-26 15:31:25 CIMFSU TCMAGT82TCM	      RCS LHFE2G6H006AGP
020-10136055 07-11-26 08:43:21 TRXRMP TCMAGT82TCM		  LHFE2G6H005QV9
020-10136055 07-11-26 15:31:27 TRXRMP TCMAGT82TCM		  LHFE1G76006AKG
020-10136055 07-11-26 15:31:31 CIMFSU TCMAGT82TCM	      RCS LHFE2G6H006AH8
020-10136066 07-11-26 08:41:20 TRXRMP TCMAGT82TCM		  LHFE2G6H005QSI
020-10136066 07-11-26 15:32:16 CIMFSU TCMAGT82TCM	      RCS LHFE2G6H006AHN
020-10136066 07-11-26 15:32:16 TRXRMP TCMAGT82TCM		  LHFE1G76006ALB
020-10136070 07-11-26 15:27:32 TRXRMP TCMAGT82TCM		  LHFE1G76006AC6
020-10136070 07-11-26 15:30:28 TRXRMP TCMAGT82TCM		  LHFE1G76006AIM
020-10136070 07-11-26 15:30:29 CIMFSU TCMAGT82TCM	      RCS LHFE1G76006AIO
020-10136081 07-11-26 15:30:37 CIMFSU TCMAGT82TCM	      RCS LHFE2G6H006AFP
020-10136092 07-11-26 08:51:17 TRXRMP TCMAGT82TCM		  LHFE1G76005RCM
020-10136092 07-11-26 15:31:17 CIMFSU TCMAGT82TCM	      RCS LHFE2G6H006AG0
020-10136092 07-11-26 15:31:18 TRXRMP TCMAGT82TCM		  LHFE2G6H006AG3
020-10136103 07-11-28 15:08:53 CIMFSU TCMAGT82TCM	      RCS LHFE1G77000W02
020-10136114 07-11-28 07:52:26 TRXRMP TCMAGT82TCM		  LHFE1G770007P9
020-10136114 07-11-28 15:12:57 CIMFSU TCMAGT82TCM	      RCS LHFE2G6I0017M

The file is really big and I want to filter those lines where the first field and the third field are the same but the fourth field in these 2 lines is different. When this is happening the lines are one after the other. You can see an example to understand with the lines in red color.
So actually I need in my output only the lines marked with red.

My first thought is with an awk to create a double for loop but I am still having huge trouble to implement this.

Can somebody help????
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Print Controls for DG Unix

Hi: We are trying to use UNIX Print Controls for our ERP Package. We have currently set up escape codes on some ERP Users for specific reports. However we would like to try to control this using DG Unix functionality that allows different printers to be set up for one physical printer. Example,... (0 Replies)
Discussion started by: baddi
0 Replies

2. UNIX for Dummies Questions & Answers

Solaris 10 Resource Controls

I've always been accustomed to setting certain kernel parameters in the /etc/system file. However, with Solaris 10, they have created the resource control utility to set these values. I've set the value for project.max-shm-memory to 4gb with the following command: prctl -n... (2 Replies)
Discussion started by: here2learn
2 Replies

3. Programming

Why is subclassing not allowed for many of the SWT Controls?

hi guys, Why is subclassing not allowed for many of the SWT Controls? But Eclipse itself creates our Shell classes in this way (inheriting from Shell) and then overriding checkSubclass() with empty body. So is it good(safe) that we do this way? I have two shells (Shell_1, Shell_2). Shell_1 is... (0 Replies)
Discussion started by: majid.merkava
0 Replies

4. Solaris

What is the Solaris OS deamon which controls Library?

Hi All, What is the Solaris OS deamon which controls the Libraries? Regards, Rakesh. (2 Replies)
Discussion started by: rakesh.413
2 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 04:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy