Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

awk compare columns and rows

Status
Not open for further replies.

johnchandler32

Programmer
Nov 1, 2012
1
0
0
US
Good Morning.
I am new to awk so please be patient.

I have a files that looks like this:

QQQQ "QRST 1212" SELL 8885.00 0 3 09283000
QQQQ "QRST 1212" SELL 8900.00 0 1 09460800
QQQQ "QRST 1212" SELL 8905.00 0 5 09465600
QQQQ "QRST 1212" BUY 8900.00 2 0 09484400
QQQQ "QRST 1212" BUY 8915.00 10 0 09501500
QQQQ "QRST 1212" BUY 8915.00 4 0 09511300
QQQQ "QRST 1212" SELL 8950.00 0 2 10465900
QQQQ "QRST 1212" SELL 8950.00 0 4 10491800
QQQQ "QRST 1212" SELL 8950.00 10 0 10491800
QQQQ "QRST 1212" BUY 8950.00 0 10 10491800
QQQQ "QRST 1212" SELL 8950.00 0 16 10491800
QQQQ "QRST 1212" BUY 8960.00 16 0 10491800

My Goal is print out a list with the same price ($4) Quantity ($5 or $6) and time ($7) only if $3 is different in the next row.

Output would look like:
QQQQ "QRST 1212" SELL 8950.00 10 0 10491800
QQQQ "QRST 1212" BUY 8950.00 0 10 10491800
QQQQ "QRST 1212" SELL 8950.00 10 0 10491800
QQQQ "QRST 1212" BUY 8950.00 0 10 10491800



Any help will be appreciated!


 
What have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top