back at this forum again. Have a tab separated file like this ---
Here is the question I have at hand(this data is from a Credit card transaction log), I need to find out what are the various Accounts that have the Authorization and Settlement receipts with the same Transaction id(the last column). In other words, I want to see the following result from the above file -
So, I have to find out what is the value of the first column and then compare that value with another sets of rows and find out which one matches and then see if the value of the first column are the same along with the value of the last column.
Here is what I did on this one. All I could do is sort the records out based on Column1 and Column4. After that point, I dont know how to go ahead with the rest and I look like a fool to myself.
Please help.
regards,
PGonzalez.
Last edited by Scott; 09-25-2011 at 06:11 AM..
Reason: Code tags, please...
Amazing. Perfect results. Ran this even on a file with 200,000 rows and came back at me under 1 minute.
Big big thanks.
Btw, can you please please decipher this for me as I might have to extrapolate this for maybe 4 rows instead of 2 as I mentioned in here & as such, some explanation would be very timely.
regards,
PGonzalez.
Last edited by PG3; 09-25-2011 at 06:21 AM..
Reason: Making myself clearer
Thanks a bunch for making yourself clear in you are doing here but I dont get it completely. I think I should pick up the Kernighan's book on Awk.
First things first, "Thanks for the help".
At any rate, 2 new challenges. When I run the newly pasted, line, it doesnt run and errors with the following message and Im pasting directly over here. Im running bash btw.
Also, how do I run this same line for 3 RECORDS not 2 RECORDS and here is the real business scenario for this. Lets say the transaction is coming from a restaurant, it has initial authorization amount as Authorized amount and then the customer lets say is nice enough to add a gratuity(tip) to it. So when the merchant presents the transaction to the bank, then the final amount would be different from amount Authorized. So, how do I reconcile these three sets of records ?
Please advise.
regards,
PGonzalez.
Last edited by Scott; 09-25-2011 at 08:31 AM..
Reason: Code tags
Hello guys this is my first post in this forum. Since now ive been passive an ive only been looking for existing information. Now I could use specific help on a UNIX script i want to make that would:
1. Take 1-3 arguments.
2. Display the contents of its arguments, formatted as follows:... (7 Replies)
I have a file with 50,000 records in it, i have a requirement to use the same 50,000 records and add them 4 times to the same file to make a total of 200,000 records. I was wondering how to do this using ksh. Any help is greatly appreciated. (2 Replies)
i have a pipe delimited file with records spread in many lines.
i need to extract those records
1)having X in beginning of that record
2)and having at least one Y in beginning before other record begins
eg:
X|Rec1|
A|Rec1|
Y|Rec1|
X|Rec2|
Y|Rec2|
Z|Rec3|
X|Rec4|
M|Rec4|
... (4 Replies)
Hi All,
I have two files say file1 and file2.
I want to check the number of records in file1 and if its atleast 2 (i.e., 2 or greater than 2 ) then I have to check records in file2 .If records in file2 is atleast 1 (i.e. if its not empty ) i have to set some conditions .
Could you pls... (3 Replies)
I have two files one (numbers file)contains the numbers(approximately 30000) and the other file(record file) contains the records(approximately 40000)which may or may not contain the numbers from that file.
I want to seperate the records which has the field 1=(any of the number from numbers... (15 Replies)