Sponsored Content
Top Forums Shell Programming and Scripting Compare two date columns in same file Post 302891652 by suresh_target on Friday 7th of March 2014 02:46:07 AM
Old 03-07-2014
Compare two date columns in same file

Hi All,

Need to compare two date columns from the filname FinalDate.txt. My data's are like below

HTML Code:
D_OT_START D_EXP_STR Amount
 1/3/2012   1/3/2012   5000    
 6/21/2011  6/25/2011  6000
 2/28/2011  2/28/2011  7000
 7/16/2010  8/16/2010  8000  
 7/14/2010  10/26/2010 9000
 2/13/2012  2/13/2012  10000
 8/22/2011  10/12/2011  11000
 1/18/2012  5/28/2012  12000
 
 Expected Output:
 
 Amount
 6000
 9000
 11000
Output:

If D_EXP_STR column is date greater than D_OT_START date column then I need to print the Amount column as output.

Kindly help me how can I achieve this result.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

compare today's date with date in a file

Hi I am very new to scripting, Can someone show me how to (in unix shell script) compare the system's date with a date in a file. The requirement is to somehow open this file (which will only have a date in it) and compare it with today's date. If they are equal execute a procedure below but if... (4 Replies)
Discussion started by: siog
4 Replies

2. UNIX for Dummies Questions & Answers

compare date with date in file

Hello everyone, I'm in desperate need of your help for this challenge I have below: The run_dt_tbl has only 1 column and 1 row that contains a particular date in format mmddyy. I want to some how compare today's date with the date in this table that will be preset by someone else. If the dates... (2 Replies)
Discussion started by: siog
2 Replies

3. Shell Programming and Scripting

compare file columns

I need help in file comparision. I have two files in below format: FILE_A: ------- COL1 COL2 COL3 COL4 COL5 FILE_B: ------- COL1A COL1B COL1C COL1D COL1E i want to compare for a for each row in FILE_A and FILE_B COL1 of FILE_A with COL1B of FILE_B COL3 of FILE_A with COL1E of... (1 Reply)
Discussion started by: learnoutmore99
1 Replies

4. UNIX for Dummies Questions & Answers

To compare first two columns in an excel file

Hi All, i have a excel sheet with two columns as below. column1 column2 100 100 200 300 300 400 400 400 500 600 i need to compare the values these two columns and the output should be printed in the third column...if these values are equal the output should be green and if these... (2 Replies)
Discussion started by: arunmanas
2 Replies

5. Shell Programming and Scripting

script to compare two columns in a file

Dear everyone, I need any sort of shell script or perl script would do the following. I have a txt file as follows: ;Stretnumber Resident Resdient (not in file) 16 John Mary 16 Mary Parker 16 Nancy Smith 16 Mary John 18 Trey ... (5 Replies)
Discussion started by: sasharma
5 Replies

6. Shell Programming and Scripting

ksh compare dates INSIDE a file (ie date A is > date B)

In KSH, I am pasting 2 almost identical files together and each one has a date and time on each line. I need to determine if the first instance of the date/time is greater than the 2nd instance of the date/time. If the first instance is greater, I just need to echo that line. I thought I would... (4 Replies)
Discussion started by: right_coaster
4 Replies

7. Shell Programming and Scripting

Compare Multiple Columns in one file

Hello guys, I am quite new to Shell Scripting and I need help for this I have a CSV file like this: Requisition,Order,RequisitionLineNumber,OrderLineNumber REQ1,Order1,1,1 REQ1,Order1,1,3 REQ2,Order2,1,5 Basically what I want to do is compare the first 3 fields If all 3 fields are the same... (5 Replies)
Discussion started by: jeffreybsu
5 Replies

8. Shell Programming and Scripting

Compare columns in a single file

i have the following files (all separated by tabs): file 1.txt 1 yes 2 no 3 yes 4 yes file 2.txt a no b no c yes d no i combine the above files in file 3 which looks like file 3.txt 1 yes a no 2 no b no 3 yes c yes 4 yes d no now, i need to compare the values between column 2... (3 Replies)
Discussion started by: msonoth
3 Replies

9. Shell Programming and Scripting

Compare the system date with date from a text file

I get the date that's inside a text file and assigned it to a variable. When I grep the date from the file, I get this, Not After : Jul 28 14:09:57 2017 GMT So I only crop out the date, with this command echo $dateFile | cut -d ':' -f 2,4The result would be Jul 28 14:57 2017 GMT How do I... (3 Replies)
Discussion started by: Loc
3 Replies

10. UNIX for Beginners Questions & Answers

Awk: compare values in two columns of the same file

I'm trying to learn awk, but I've hit a roadblock with this problem. I have a hierarchy stored in a file with 3 columns: id name parentID 4 D 2 2 B 1 3 C 1 1 A 5 I need to check if there are any values in column 3 that are not represented anywhere in column 1. I've tried this: awk '{arr;}... (7 Replies)
Discussion started by: kaktus
7 Replies
zgeqpf.f(3)							      LAPACK							       zgeqpf.f(3)

NAME
zgeqpf.f - SYNOPSIS
Functions/Subroutines subroutine zgeqpf (M, N, A, LDA, JPVT, TAU, WORK, RWORK, INFO) ZGEQPF Function/Subroutine Documentation subroutine zgeqpf (integerM, integerN, complex*16, dimension( lda, * )A, integerLDA, integer, dimension( * )JPVT, complex*16, dimension( * )TAU, complex*16, dimension( * )WORK, double precision, dimension( * )RWORK, integerINFO) ZGEQPF Purpose: This routine is deprecated and has been replaced by routine ZGEQP3. ZGEQPF computes a QR factorization with column pivoting of a complex M-by-N matrix A: A*P = Q*R. Parameters: M M is INTEGER The number of rows of the matrix A. M >= 0. N N is INTEGER The number of columns of the matrix A. N >= 0 A A is COMPLEX*16 array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, the upper triangle of the array contains the min(M,N)-by-N upper triangular matrix R; the elements below the diagonal, together with the array TAU, represent the unitary matrix Q as a product of min(m,n) elementary reflectors. LDA LDA is INTEGER The leading dimension of the array A. LDA >= max(1,M). JPVT JPVT is INTEGER array, dimension (N) On entry, if JPVT(i) .ne. 0, the i-th column of A is permuted to the front of A*P (a leading column); if JPVT(i) = 0, the i-th column of A is a free column. On exit, if JPVT(i) = k, then the i-th column of A*P was the k-th column of A. TAU TAU is COMPLEX*16 array, dimension (min(M,N)) The scalar factors of the elementary reflectors. WORK WORK is COMPLEX*16 array, dimension (N) RWORK RWORK is DOUBLE PRECISION array, dimension (2*N) INFO INFO is INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: November 2011 Further Details: The matrix Q is represented as a product of elementary reflectors Q = H(1) H(2) . . . H(n) Each H(i) has the form H = I - tau * v * v**H where tau is a complex scalar, and v is a complex vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i). The matrix P is represented in jpvt as follows: If jpvt(j) = i then the jth column of P is the ith canonical unit vector. Partial column norm updating strategy modified by Z. Drmac and Z. Bujanovic, Dept. of Mathematics, University of Zagreb, Croatia. -- April 2011 -- For more details see LAPACK Working Note 176. Definition at line 149 of file zgeqpf.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.2 Tue Sep 25 2012 zgeqpf.f(3)
All times are GMT -4. The time now is 10:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy